I have written (not all by me!) a DNS server/daemon in Perl. It currently implements A, NS, MX, and CNAME lookups. It also does remote queries if configured to do so. I am currently adding reverse-DNS support for it, so that it can look up entries by IP address. If you really want to test it on your own computer, set it to listen on port 53 and fire up your web browser! Plus it also handles BIND's /var/named zone files!