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

  1. Create a directory for djbdns installation and switch to it:
sudo mkdir /usr/local/src/djbdns
cd /usr/local/src/djbdns
  1. Download the djbdns package from the official website:
sudo wget -O djbdns.tar.gz http://cr.yp.to/djbdns/djbdns-1.05.tar.gz
  1. Extract the package:
sudo tar -zxvf djbdns.tar.gz
  1. Change to the extracted directory:
cd djbdns-1.05
  1. Compile and install the package:
sudo make setup check

Step 3: Configure djbdns

  1. Create a file named root in the /var/lib/dnscache directory:
sudo mkdir /var/lib/dnscache
sudo touch /var/lib/dnscache/root
  1. Create the /etc/dnscache directory and its subdirectories:
sudo mkdir -p /etc/dnscache/log/main
sudo mkdir -p /etc/dnscache/env
sudo mkdir -p /etc/dnscache/root/servers
  1. Create a file named servers in the /etc/dnscache/root directory and add the following line to it:
127.0.0.1
  1. Create the /etc/dnscache/env/IP file 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
  1. Create the /etc/dnscache/env/FORWARDONLY file and add the following line to it:
1
  1. Create the /etc/dnscache/env/CACHESIZE file 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

  1. Start the dnscache and tinydns services:
sudo svscan /service
  1. 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.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!