also door-nail, "large-headed nail used for studding batten doors for strength or ornament," late 14c.; see door (n.) + nail (n.). The figurative expression dead as a doornail is attested as early as the word itself.
But ich haue bote of mi bale bi a schort time, I am ded as dore-nail. ("William of Palerne," c. 1375).
Compare key-cold "lifeless, inanimate, devoid of heat, cold as a metal key" (1510s). Also in Middle English as a symbol of muteness (domb as a dor nail, c. 1400).