This is how to publish a simple zone with djbdns, I will be doing this on Ubunut 9.10. Start by installing djbdns.

# aptitude install djbdns

Create system accounts.

# useradd -d /etc/tinydns -s /bin/false tinydns
# useradd -d /etc/tinydns -s /bin/false tinylog

Now create the configuration directory for tinydns.

# tinydns-conf tinydns tinylog /etc/tinydns is the IP I’ll be using in this example for my dns server. Now create a symlink so that svscan will start tinydns. svscan is a part of daemontools, which is a part of the djbdns package, it is used to start and monitor services.

# ln -s /etc/tinydns /etc/service/tinydns

Verify that the service has started.

# ps aux |grep tinydns
root      1126  0.0  0.0   1560   336 ?        S    17:41   0:00 supervise tinydns
tinydns   1128  0.0  0.0   1684   364 ?        S    17:41   0:00 /usr/bin/tinydns

Good, now we’ll need to edit our data file, located at /etc/tinydns/root/data. The following is a simple data file for

Each line starts with a character, the characters above does the following.

. creates a NS record for ( and also creates a A record for A SOA record is also created. & creates another NS record for ( and also creates a A record for

  • creates A records @ creates MX records, second argument can contain a IP address (a A record is then created), not needed in our example since I use gmail.

You can find more info in this here.

Now create the data.cdb file, this is a read optimized file that tinydns uses.

# cd /etc/tinydns/root/
# make

Verify that your server answers requests.

# dig @ soa

; <<>> DiG 9.6.1-P1 <<>> @ soa
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63331
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; WARNING: recursion requested but not available

;			IN	SOA

;; ANSWER SECTION:		2560	IN	SOA 1263665910 16384 2048 1048576 2560


;; ADDITIONAL SECTION:		86400	IN	A		86400	IN	A

;; Query time: 0 msec
;; WHEN: Sat Jan 16 18:28:35 2010
;; MSG SIZE  rcvd: 142