Installation of djbdns on Debian 8.
For this tutorial we will configure a server, with the ip address 192.168.0.1, that is responsible for the xpto.com domain.
Steps
DJBDNS is not available on debian repositories, therefore we will install it from sources. We will install some dependecies to support the execution of the service. Install the following packages:
apt-get install make gcc
apt-get install daemontools
apt-get install daemontools-run
apt-get install ucspi-tcp
After, download the djbdns source:
wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
Compile and Install it:
gunzip djbdns-1.05.tar.gz
tar -xf djbdns-1.05.tar
cd djbdns-1.05
echo gcc -O2 -include /usr/include/errno.h > conf-cc
make
make setup check
Then we will create two users to execute the tinydns and dnslog service:
adduser --no-create-home --disabled-login --shell /bin/false dnslog
adduser --no-create-home --disabled-login --shell /bin/false tinydns
To initialize the service, execute:
tinydns-conf tinydns dnslog /etc/tinydns/ 192.168.0.1
Configure service to start on boot with daemontools:
update-service --add /etc/tinydns
Configure base nameserver for domain
cd /etc/tinydns/root
./add-ns xpto.com 192.168.0.1
./add-ns 0.168.192.in-addr.arpa 192.168.0.1
make
Example of adding an host and alias. We will add the entry lion.xpto.com to resolve to the ip 192.168.0.2, and two alias: the www and blog.
cd /etc/tinydns/root
./add-host lion.xpto.com 192.168.0.2
./add-alias www.xpto.com 192.168.0.2
./add-alias blog.xpto.com 192.168.0.2
make
The services can be restated by using systemctl to restart all daemontools services.
DJBNS can also be configured with the services for caching.
References
http://cr.yp.to/djbdns/run-server.html
http://cr.yp.to/djbdns/install.html
http://ubuntuforums.org/showthread.php?t=1630044
https://www.howtoforge.com/install-djbdns-nameserver-on-debian-etch#-installing-djbdns
http://www.itworld.com/article/2785826/open-source-tools/installing-the-djbdns-software.html