djbdnsrocks.org latest news
A major site renovation is under way. Please excuse the mess while this is in progress.
Home
About
The Installation
Extra Options
faq
Journal of Events
Links
The future
Contact Me

Single server DNS solution
- Under the hood -

So now you've got your DNS server installed, configured, tested and running. However, I haven't really showed you much of backend. We've installed an easy to use web interface for managing our domains, but it's important to know what's going on in the backround. It's important to know how to create zone entries manually, how change settings and gernally know where everything is at. If you know the backend, it will come in handy should you run into problems in the future as some knowledge of the backend aids tremendously when troubleshooting issues. After all we're UNIX people, not Windows goons. I want you to know more than just how to press pretty buttons.

Tinydns

On the single server setup I've documented here, Tinydns runs out of /etc/tinydns (primary nameserver) and /etc/tinydns2 (secondary nameserver). Within each tinydns directory are a number of files and folders. Let's go over some of them now.

env - Contains environmental variables for the tinydns server. There are 2 files in this directory:

     IP - This file contains the IP that the tinydns server listens on. Pretty straight forward.

     ROOT - Contains the path to the Tinydns root directory. We'll cover this in more detail below.

log - You can guss what this directory is for. The tinydns server logs stored here are stored in          much the same way qmail does it's logging. If you're familiar with qmail logs, this should also          be familiar stuff. There are a several files and directories to comment on in the logs          directory:

     main - Where the main log files live. You will find the active "current" log file here as well as the                 older logs that have rotated out of service. Older archived logs files begin with a "@".

     run - The run script that governs how tinydns logs. Again, qmail fans should recognize this               stuff.

     status - A zero length file serving as a status indicator. Never touch this file.

     supervise - The supervise scripts for the logger. Never touch these.

root - The heart of the tinydns server:

    data - The plain text file which contains the zone entries for all domains on your nameserver.               This is the file that DNS changes are written to (either manually or by VegaDNS) before               they are converted to cdb format.

    data.cdb - After "make" is run, the zone entries in the "data" files are converted into a simple                      database called "data.cdb" which can be read very fast by your tinydns server.

    add-xxxx scripts - These are ready made scripts for adding zone entries to the "data" file. If you                                 are using VegaDNS or some other tinydns managment too, you won't need to                                 use these.

run - The tinydns run script. Never touch unless you know what you are doing

supervise - The tinydns supervise scripts. Again, don't touch.

status - A zero length status file. Never touch.

DNScache

Dnscache runs out of /etc/dnscache. If you take a look inside, you'll see that it looks a lot like Tinydns is the way it's set up. This should be familiar stuff by now, but let's go over a few things that are specific to DNScache...

env - Contains environmental variables for the dnscache caching nameserver. There are 2 files in this directory:

     IP - This file contains the IP that the cnscache server listens on. Pretty straight forward. An                    internal caching nameserver, like we've set up in this guide, should have 127.0.0.1 in this             file.

     ROOT - Contains the path to the dnscache root directory.

     CACHESIZE - This file simply contains a number that represents how large your dnscache will                             get (bytes) before it refreshes. By default it's set to 1000000 bytes, or roughly                             1MB. Setting this number lower will cause you caching nameserver to refresh                             itself more frequently. Alternatively, setting it higher allows your server to cache                             DNS info for a longer period of time. Unless you have a specific reason for                             changing it, it's best to just leave it as is.

     DATALIMIT - Contains the path to the dnscache root directory.

     IPSEND - The IP address on which dnscache send outgoing packets. This should typically                      read 0.0.0.0. Don't mess with this unless you know what you are doing.

log - Again, you can guss what this directory is for. The dnscache server logs stored here are stored in much the same way qmail and tinydns do their logging. I'm not going to repeat myself, since the loggin setup is pretty much identical to the tinydns setup above.

root - The heart of the dnscache caching nameserver:

    ip- A directoty containing zero length files named for hosts which are allowed to query this          caching nameserver. If you've used this guide, there should be one file in there called          127.0.0.1. This means that 127.0.0.1 is allowed to query this caching nameserver. You can          add other allowed hosts by touching a new file (example: touch 1.2.3.4). buit since this          caching nameserver is only running on an internal IP of 127.0.0.1, external hosts wont be          able to see it. If you want external hosts to be able to use your server as a caching          nameserver, you have to to set up a seperate external nameserver.

    servers - Typically contains a single file called "@" which contains a list of the internet's root                    nameservers. Don't mess with this unless you know what you're doing.

run - The tinydns run script. Never touch unless you know what you are doing

supervise - The tinydns supervise scripts. Again, don't touch.

seed- The seed which dnscache reads and then passes to dns random init. Don't touch.

 

Proceed to step 9

 

Modified
Site last modified: October 08, 2006 11:07:54 EDT
   
 
The Rocks Project