Working with DNSCache


Recently, a friend of mine guided me towards using DNSCache as a replacement for BIND. Since I already use the QMail package, I figured I would give DNSCache a try.

The DNSCache package is not a straightforward all-in-one nameserver package. Each function of the name server is its own process, and lives in its own directory with its own configuration; there is a separate program for zone transfers (axfrdns), caching servers (dnscache), and a name server (tinydns). Some othr tools included with the DNSCache package are dnswall (handy when you run split dns. This supplies generic hostnames for reverse/in-addr.arpa queries), pickdns (a load balancing dns server), and rbldns.

The DNSCache program relies on two other packages; daemontools which is a collection of tools for managing processes, ucspi-tcp which are command line tools (tcpserver/tcpclient) used to build TCP client-server apps If you are going to use DNSCache, I suggest you also look at (not necessary but useful) cdb Dan's fast platform independent database format which many of his tools use for storing data.

For my scenario, I wanted to publish a set of zones, provide zone transfers for my secondary name servers, and act as a caching server for my local network. Howerver, I wanted to do this all on one box, like I could with BIND. This is definitely possible, however, the design of DNSCache does not allow for all of this to happen on the same IP address. For example; dnscache (the caching server) allows both tcp and udp lookups, thus it listens to both tcp:53 and udp:53 ports. Thus you cannot run both dnscache and either axfrdns (the zone transfer process) or tinydns (the name server) on the same IP address. In order to do this, I had to set up an aliased IP address on my ethernet interface. Once I had all the software ready to be configured, I took the following steps to get DNSCache working on my machine:

Now your DNS servers should be fully operational. Thanks to the following people for advice, support, and in some cases, a great deal of patience.


Written by Adam R. Prato on 6/5/2000