...As for “dag nab,” it’s a variation of “dad-gum,” a member of another branch of the same family. The slang dictionary says that “dad,” when used as an interjection in combination forms, is “a euphemistic alteration of God … used in various mild oaths.” The first such usage, “by Dad,” was recorded in 1678.
Variations on this theme include (and I won’t attempt to give all the spellings) “dad-bing,” “dad-blame,” “dad-blast,” “dad-bloom,” “dad-burn,” “dad-gum,” daggone,” and “dagnab.”
As a child growing up in Iowa, I often heard irritated grownups say “gol-dang-it” or “what the ding-dong!”
http://www.grammarphobia.com/blog/2008/12/euphemysticism.html

∆∆