Installing djbdns on Debian9 Stretch

Djbdns not included in Debian archives, but you can install djbdns - tinydns with following procedure:

Install the required daemontools, daemontools-run and ucspi-tcp packages first:

apt install daemontools daemontools-run ucspi-tcp

If you don’t have compiler toolchain, install it before going into djbdns compilation stage:

apt install build-essential

Now download djbdns source and build it:

wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
tar xf djbdns-1.05.tar.gz
cd djbdns-1.05/
echo gcc -O2 -include /usr/include/errno.h > conf-cc
make
make setup check

Create the required users for tinydns and dnslog:

useradd --no-create-home --shell /bin/false Gtinydns
useradd --no-create-home --shell /bin/false Gdnslog

Create initial tinydns configuration:

tinydns-conf Gtinydns Gdnslog /etc/tinydns [DNS-SERVER-IP]
ln -s /etc/tinydns /etc/service

That’s all, it’s working:

ps uax | grep tinydns
root      1657  0.0  0.0   4056   696 ?        S    21:05   0:00 supervise tinydns
tinydns   1659  0.0  0.0   4192  1168 ?        S    21:05   0:00 /usr/local/bin/tinydns
tinydns   1660  0.0  0.0   4072   676 ?        S    21:05   0:00 multilog t ./main