Requirements of TinyDNS
Copied with permission from the author. Original site is at http://www.djbdnsrocks.org
1) At least 2 unused IP addresses. 1 is usually fine.
2) Daemontools - This was installed if you did my qmail install. If not, please install that step!
3) UCSPI-TCP - This was also installed if you did my qmail install. If not, please install that step too!
4) You will want ports 22 (SSH) and 53 (DNS) open. If you don't want anyone outside of your network using your DNS server (Personally, I don't pass this port either) don't forward port 53.
That is about it. When all those requirements have been met, You can now continue.
Installing TinyDNS
The first step is to install the daemon-tools:
# cd /opt
# wget http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
# gunzip daemontools-0.76.tar
# tar -xpf daemontools-0.76.tar
# rm -f daemontools-0.76.tar
# cd admin/daemontools-0.76
# vi src/conf-cc
Append the following line at the end of the gcc line: -include /usr/include/errno.h
# ./package/install
One other package we need to prepare for djbdns to be functional is ucspi:
# cd /opt
# wget http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
# gunzip ucspi-tcp-0.88.tar
# tar -xf ucspi-tcp-0.88.tar
# cd ucspi-tcp-0.88
# vi src/conf-cc
Append the following line at the end of the gcc line: -include /usr/include/errno.h
# make
# make setup check
The next step is the document publication:
# cd /opt
# wget http://cr.yp.to/djbdns/doc.tar.gz
Next we will unzip docs under /doc :
# gunzip < doc.tar.gz | (cd /; tar -xf -)
Use the following script to merge in system docs:
#!/bin/sh
for i in packages commands cfunctions fileformats
do
sort -f /dev/null `find /doc/merge -name $i.html` > /doc/$i.new
mv /doc/$i.new /doc/$i.html
done
Save script into a file: script.sh
# chmod +x script.sh
# ./script.sh
# cd /opt
# wget http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
# gunzip djbdns-1.05.tar
# tar -xf djbdns-1.05.tar
# cd djbdns-1.05
# vi src/conf-cc
Append the following line at the end of the gcc line: -include /usr/include/errno.h
# make
# make setup check
All compiling gets done.
The next step is the dns server configuration.
Configuring TinyDNS
We need two system user accounts:
#groupadd -g 200 nofiles
#useradd -g nofiles -u 201 -d /var/dnscache -c "tinydns" -s /sbin/nologin tinydns
#useradd -g nofiles -u 202 -d /var/dnscache -c "tinydns" -s /sbin/nologin tinylog
#tinydns-conf tinydns tinylog /var/tinydns <listened IP>
Starting TinyDNS
Now start the service with the following command:
#ln -sf /var/tinydns /service
You can verify it is running by typing:
#svstat /service/tinydns
Configuring TinyDNS
Once again, we need two system user accounts:
#useradd -g nofiles -u 203 -d /var/dnscache -c "axfrdns" -s /sbin/nologin axfrdns
#useradd -g nofiles -u 204 -d /var/dnscache -c "axfrdns" -s /sbin/nologin axfrlog
#axfrdns-conf axfrdns axfrlog /var/axfrdns /var/tinydns <listened IP>
Starting axfrDNS
Now start the service with the following command:
#ln -sf /var/axfrdns /service
You can verify it is running by typing:
#svstat /service/axfrdns
Stop TinyDNS & axfrDNS
svc -d /service/tinydns
svc -d /service/axfrdns
Start TinyDNS & axfrDNS
svc -u /service/tinydns
svc -u /service/axfrdns