For some reason those always crap out on me while OzymanDNS (the first major implementation in perl by dan kaminski) works pretty much every time, though it's quite different in operation.
To implement your own custom DNS server,
use Net::DNS::Nameserver; # (and see ozymandns for implementation example)
To implement your own custom DNS server, use Net::DNS::Nameserver; # (and see ozymandns for implementation example)