Serving DNS with mod_perl and Apache
By mock from Victoria.pm
Date: Friday, 2 September 2005 15:20
Duration: 20 minutes
APR is capable of abstracting more than just TCP connections. With a
simple patch to Apache, mod_perl can be used to serve UDP based protocols,
such as DNS.
BIND has always been the standard for serving DNS. However BIND is not
very modular, and is quite restrictive about the architectures one can
choose when serving DNS. As well, it would be nice to be able to modify
DNS responses based on arbitrary characteristics, ideally using a
scripting language like perl. By making Apache serve UDP, and then
attaching that to a DNS server written in perl, all the advantages of
the Apache and mod_perl platform can be brought to DNS.
Making it Work
A detailed explanation of how to work with UDP based protocols from within
mod_perl is given. Integration with Net::DNS is shown, as well as
an example of proxying DNS traffic.
What's it Good For?
Some examples of useful behaviour from a DNS server integrated into Apache
are given. Including better load balancing based on DNS, web service based
control of DNS, DNS proxying, and serving DNS from non zone file sources.
A comparison is made between mod_perl based DNS implementations, pure perl
implementations of DNS (such as Net::DNS::Nameserver) and C based
implementations such as BIND, djbdns, and MyDNS.