In this tutorial, we will learn how to install NSD (Name Server Daemon) on Elementary OS Latest.
NSD is an authoritative DNS server that is used to handle high traffic domain names. It is developed and maintained by NLnet Labs. NSD is a free and open-source software, licensed under BSD.
Before installing NSD, make sure you have the following:
First, update your system to make sure all packages are up-to-date.
sudo apt-get update
sudo apt-get upgrade
Run the following command to install NSD on your system:
sudo apt install nsd
Once NSD is installed, you will need to configure it to work properly.
By default, NSD is configured to listen on localhost (127.0.0.1) only. If you want your DNS server to be accessible from other machines on your network, you need to edit the configuration file to listen on all interfaces.
Open the configuration file NSD:
sudo nano /etc/nsd/nsd.conf
Uncomment and modify the following lines to allow NSD to listen on all interfaces:
server:
ip-address: 0.0.0.0
Save and close the file.
By default, NSD is not configured to use a zone file. You will need to create a zone file for your domain and configure NSD to use it.
Create a new zone file for your domain:
sudo nano /etc/nsd/zones/example.com.zone
Add the following content to it:
$ORIGIN example.com.
$TTL 3600
@ IN SOA ns1.example.com. admin.example.com. (
2014010101 ; serial
1800 ; refresh
900 ; retry
604800 ; expire
3600 ; minimum TTL
)
IN NS ns1.example.com.
IN A 192.168.1.100
ns1 IN A 192.168.1.100
Replace "example.com" with your own domain name and "192.168.1.100" with your own IP address.
Save and close the file.
Open the NSD configuration file:
sudo nano /etc/nsd/nsd.conf
Add the following lines to it to use the zone file:
zone:
name: "example.com"
zonefile: "/etc/nsd/zones/example.com.zone"
Replace "example.com" with your own domain name.
Save and close the file.
Start the NSD daemon:
sudo systemctl start nsd
Enable the NSD daemon at boot:
sudo systemctl enable nsd
To verify that NSD is working properly, run the following command:
nslookup example.com localhost
Replace "example.com" with your own domain name.
You should see the IP address you assigned to your domain in the zone file.
That's it! You have successfully installed and configured NSD on Elementary OS Latest.
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!