How to Install djbdns from http://cr.yp.to/djbdns.html on Ubuntu Server Latest
Step 1: Install Dependencies
Before installing djbdns, you need to install the required dependencies. Run the following command:
sudo apt-get install daemontools daemontools-run ucspi-tcp ucspi-proxy
Step 2: Download and Install djbdns
- Create a directory for djbdns installation and switch to it:
sudo mkdir /usr/local/src/djbdns
cd /usr/local/src/djbdns
- Download the djbdns package from the official website:
sudo wget -O djbdns.tar.gz http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
- Extract the package:
sudo tar -zxvf djbdns.tar.gz
- Change to the extracted directory:
cd djbdns-1.05
- Compile and install the package:
sudo make setup check
Step 3: Configure djbdns
- Create a file named
rootin the/var/lib/dnscachedirectory:
sudo mkdir /var/lib/dnscache
sudo touch /var/lib/dnscache/root
- Create the
/etc/dnscachedirectory and its subdirectories:
sudo mkdir -p /etc/dnscache/log/main
sudo mkdir -p /etc/dnscache/env
sudo mkdir -p /etc/dnscache/root/servers
- Create a file named
serversin the/etc/dnscache/rootdirectory and add the following line to it:
127.0.0.1
- Create the
/etc/dnscache/env/IPfile and add the IP address of the primary DNS server you want to use:
echo "1.2.3.4" | sudo tee /etc/dnscache/env/IP
- Create the
/etc/dnscache/env/FORWARDONLYfile and add the following line to it:
1
- Create the
/etc/dnscache/env/CACHESIZEfile and add the maximum amount of memory, in bytes, that you want dnscache to use for caching queries. For example:
echo "100000" | sudo tee /etc/dnscache/env/CACHESIZE
Step 4: Start and Enable djbdns
- Start the dnscache and tinydns services:
sudo svscan /service
- Enable the services to start at boot time:
sudo update-service add /service/dnscache
sudo update-service add /service/tinydns
Conclusion
You have successfully installed and configured djbdns on your Ubuntu server. You can now use it as your primary DNS server.