I have a linux server has an ad-hoc wireless network for clients to connect to. Once connected I want users to always be redirected to it\'s own web server no matter what URL th
I would suggest using dnsmasq. It's more full-featured than you absolutely need, but it's very well-written, small, and easy to install, and the only configuration you would need to give it is --address='/#/1.2.3.4'
to tell it to answer all queries (that don't match some other rule) with the address 1.2.3.4. dnsmasq is well-known and maintained and probably a more robust server than Net::DNS::Nameserver.
As I answered in the other related question, I wrote a basic DNS server in C++ for a job interview under BSD license.
I think the code was pretty clean, though I didn't made unit tests :-( I tested it with dig, and it took about a week understanding DNS protocol + implementing + documentation.
If anyone would want to extend it, I guess it would not be very difficult. Because I think it only supported inverse queries, as that was asked in the exercise.
The code could be found here: http://code.google.com/p/dns-server/
It was migrated to: https://github.com/tomasorti/dns-server
I've used fakedns.py when reversing malware. It may be too limited for your situation.
Use Net::DNS::Nameserver and write your own reply handler.
For C, look at: