How to install tinydns / dnscache on Ubuntu Server 64 bit Version
Jimmy Brake Mar 31, 2008

Installing djbdns on ubuntu linux server can be rather difficult if you are not familiar with the exact procedure. Here is how to apply the needed patches and install all the gcc stuff, The documentation at is very good and we are borrowing heavily from it and a previous article we wrote about installing daemontools on suse,


To start open a terminal on the ubuntu linux server you are planning to install tinydns on(we are assuming you have none of the djb software installed).


Become the root user.


sudo su -


Get the patches:


mkdir -p /usr/local/djb/patches

cd /usr/local/djb/patches


tar xfvz djb_errno_patches.tgz

Install daemontools:

Create a /package directory:

     mkdir -p /package
chmod 1755 /package
cd /package

Install the things you will need to patch and compile daemontools

apt-get install build-essential


Download daemontools-0.76.tar.gz into /package. Unpack the daemontools package:


     gunzip daemontools-0.76.tar
tar -xpf daemontools-0.76.tar
rm daemontools-0.76.tar
cd admin/daemontools-0.76

Patch Daemontools

touch /etc/inittab

patch -p1 < /usr/local/djb/patches/daemontools-0.76.errno.patch


Compile and set up the daemontools programs:

vim /etc/event.d/svscan

then insert:


# svscan - daemontools



start on runlevel 2
start on runlevel 3
start on runlevel 4
start on runlevel 5

stop on runlevel 0
stop on runlevel 1
stop on runlevel 6

exec /command/svscanboot


then (you might need to reboot)

initctl start svscan


To report success: (you cannot do this yet since there is no mail command on ubuntu)

mail < /package/admin/daemontools/compile/sysdeps



move to the /user/src dir(this is just where I always do all the building and compiling that I need to do)


cd /usr/src


Download the ucspi-tcp package. The latest published ucspi-tcp package is ucspi-tcp-0.88.tar.gz.

Unpack the ucspi-tcp package:

     tar xfvz ucspi-tcp-0.88.tar.gz
cd ucspi-tcp-0.88


patch -p1 < /usr/local/djb/patches/ucspi-tcp-0.88.errno.patch

Compile the ucspi-tcp programs:


As root, install the ucspi-tcp programs under /usr/local:

     make setup check

To report success: (we still have no mail program)

( echo 'First M. Last'; cat `cat SYSDEPS` ) | mail

Replace First M. Last with your name.


Install DJBDNS


move back to your /usr/src


cd /usr/src


Download the djbdns package. The latest published djbdns package is djbdns-1.05.tar.gz.



Unpack the djbdns package:

     gunzip djbdns-1.05.tar.gz
tar -xf djbdns-1.05.tar
cd djbdns-1.05

Compile the djbdns programs:

 echo gcc -O2 -include /usr/include/errno.h > conf-cc 
 As root, install the djbdns programs under /usr/local:

make setup check


At this point you should be able to configure it many different ways, oh and don't forget to open your firewall.


The link below will bring you back to the djb site for configuring djbdns ..


For configuring a name server ... (note don't install both servers on the same hardware)

useradd -r Gtinydns

useradd -r Gdnscache

useradd -r Gdnslog

For tinydns

tinydns-conf Gtinydns Gdnslog /etc/tinydns

ln -s /etc/tinydns /service

For dnscache

dnscache-conf Gdnscache Gdnslog /etc/dnscache
ln -s /etc/dnscache /service
touch /etc/dnscache/root/ip/10
Change (10) to your servers ip address ... then test(either tinydns or dnscache) 
dig @

For configuring walldns

useradd -r Gwalldns
useradd -r Gdnslog
walldns-conf Gwalldns Gdnslog /etc/walldns
cd /service/
ln -s /etc/walldns .
svc -u /service/*

test .... dig @ -x


Page 1 of 1

create discussion Create Discussion