DJBdns are a set of applications that retrieve and publish Domain Name System (DNS) information.
Home: http://cr.yp.to/djbdns.html
The following procedure describes How To install the DJBdns software package in Ubuntu Linux (8.04 LTS) to act as a DNS Cache
1. sudo aptitude install build-essential
2. test -d /tmp/downloads && sudo rm -fr /tmp/downloads
3. mkdir -p -m 1755 /tmp/downloads && cd /tmp/downloads
1. cd /tmp/downloads
2. wget -c http://cr.yp.to/daemontools/daemontools-0.76.tar.gz
3. tar -xvzf daemontools-0.76.tar.gz
4. sed -i -e '/^extern int errno\;/ c\#include <errno.h>\' admin/daemontools-0.76/src/error.h
5. sudo touch /etc/inittab # /etc/inittab isn't used in Ubuntu anymore, but the daemontools install script still needs it
6. create an upstart file (http://upstart.ubuntu.com/) inside /etc/event.d/:
sudo bash -c "cat > /etc/event.d/svscan <<-EOA
# svscan - daemontools
# This service starts daemontools from the point the system is
# started until it is shut down again.
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
respawn
exec /command/svscanboot
EOA" ;
7. cd admin/daemontools-0.76
8. sudo package/install
9. sudo rm -rf /command/*
10. sudo cp -av /tmp/downloads/admin/daemontools/command/* /command/
11. sudo initctl start svscan # upstart svscan (/sbin/start = /sbin/initctl).
1. cd /tmp/downloads
2. wget -c http://cr.yp.to/ucspi-tcp/ucspi-tcp-0.88.tar.gz
3. tar -xvzf ucspi-tcp-0.88.tar.gz
4. cd ucspi-tcp-0.88
5. sed -i -e '/^extern int errno\;/ c\#include <errno.h>\' error.h
6. make
7. sudo make setup check
1. cd /tmp/downloads
2. wget -c http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
3. tar -xvzf djbdns-1.05.tar.gz
4. cd djbdns-1.05
5. echo gcc -O2 -include /usr/include/errno.h > conf-cc
6. make
7. sudo make setup check
Check if it is working:
1. sudo groupadd djbdns
2. sudo useradd -d /dev/null -s /bin/false -g djbdns dnslog
3. sudo useradd -d /dev/null -s /bin/false -g djbdns dnscache
4. -
5. sudo mkdir /var/lib/svscan
6. sudo dnscache-conf dnscache dnslog /var/lib/svscan/dnscache
7. sudo ln -sf /var/lib/svscan/dnscache /service
8. sleep 5 && sudo svstat /service/dnscache # check if it is working
9. upgrade root servers:
10. control: restart and stop djbdns
If your computer is running a DHCP client to obtain a dynamically assigned IP address, configure the DHCP client to use dnscache (listening at 127.0.0.1):
11. sudo dhclient # if your network uses a dhcp client
12. sudo /etc/init.d/networking restart # if it has a fixed IP (or, you may need to reboot)
To check the new nameservers address:
To check if dnscache is working:
a) Documentation and Man pages are available from: http://smarden.org/pape/djb/ , to install them: wget -c http://smarden.org/pape/Debian/dists/woody/unofficial/binary-i386/djbdns-doc_1.05-4_all.deb && sudo dpkg -i djbdns-doc_1.05-4_all.deb
b) Also see: http://www.linuxjournal.com/article/10112
c) To see how to adjust the cache size see: http://cr.yp.to/djbdns/cachesize.html
d) Perfect DjbDNS Setup On Ubuntu Server 8.04 (amd64) Hardy <http://www.howtoforge.com/perfect-djbdns-setup-on-ubuntu8.04-amd64>
e) Install Djbdns on Ubuntu Server: <http://www.rasyid.net/2008/07/08/install-djbdns-on-ubuntu-server/>
f) For an Debian/Ubuntu way to install djbdns, i.e. using "sudo apt-get install daemontools djbdns qmail cvm" see: http://smarden.org/pape/Debian/djbdns.html