First attested in 1602 as dork, in the later 17th century as durk. The spelling dirk is due to Johnson's Dictionary of 1755.
Early quotations as well as Johnson 1755 suggest that the word is of Scottish Gaelic origin, but no such Gaelic word is known. The Gaelic name for the weapon is biodag. Gaelic duirc is merely an 18th-century adoption of the English word.
A possible derivation is from the Scandinavian personal name Dirk (short for Diederik), which is used of lock-picking tools (but not of knives or daggers). Another possibility is that dork originates as a sailor's or soldier's corruption of dolk, the Dutch and Scandinavian form of German Dolch ("dagger").