DJBDNS: The pieces

By Brian Hatch, ITworld |  News

DJBDNS has many separate pieces, not all of which you necessarily need.
The separate pieces include:

* dnscache -- This is the recursive caching name server, which
simply looks up the DNS records you request. It consults the
thirteen root DNS servers and winds it's way up to the answer.
You can also associate zones with name servers manually to support
non-official zones, such as internal networks. dnscache listens on
both TCP and UDP port 53.
* tinydns -- This is the DNS server you run to let others resolve
your hostnames and IP addresses. It will only serve the data that
you've given it, so you cannot point to it as your default name
server -- point to a dnscache IP address instead. tinydns listens
on UDP port 53.
* axfrdns -- This server allows authorized BIND secondary DNS
servers to mirror your zone files. The 'official' DJBDNS way to
synchronize zones is to simply rsync the files from the master to
the slaves. However, for compatibility with BIND's zone transfers,
you can run axfrdns. axfrdns listens to TCP port 53.

You may have noticed above that dnscache and tinydns both want to listen
on UDP port 53. That means that you cannot have both of these processes
listening on the same IP address. DJB's official retort is that you
should be using separate machines for this purpose anyway, which is
pretty much true. However, if you want to run both on the same machine,
then you can run each on it's own virtual IP address (eth0:0 vs eth0:1,
etc...) or you could run dnscache on localhost (available only to that
machine) and tinydns on the external interface. The network setup you
pick will depend on your needs.

Each of these servers are run through the supervise/svscan processes we
installed earlier. These processes require a special directory layout to
define the programs to run; however, you can run configuration programs
to handle the grunt work. Let's start off by setting up dnscache:

# dnscache-conf dnscache dnslog /etc/dnscache 127.0.0.5

The arguments are:

* dnscache -- The user the daemon will run as.
* dnslog -- the user the logging component will run as.
* /etc/dnscache -- The directory to set up for supervise.
* 127.0.0.5 -- The IP address dnscache should listen on.

For now I'm setting the IP address to be 127.0.0.5 because it's a
convenient way to test things.[1] If you already have BIND listening on
localhost (127.0.0.1) then using 127.0.0.5 won't conflict and we can
verify all is well before turning off BIND.

This creates the following directories inside /etc/dnscache:

* env/ -- Any files in here are environment variables that will be
set for the dnscache process. For example the file 'IP' contains
'127.0.0.5' for our current setup. Dnscache uses environment
variables for all its configuration.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question