(exclaimation) Oldcootism used during great consternation or surprise. Used by 1890’s prospectors, cantankerous old farmers, and young people playing old people on TV in the ‘60’s and ‘70’s.
Them dern aliensruined my golldarn rubbarb patch with their flyin' machine, dagnabbit!
Dagnamit, get those cork boots off my new shoes.
A note on pronunciation: dag is drawn out into two syllables deh-ig, namit is compressed into nearly a single flip.