NSD is an open source, authoritative-only DNS server developed by NLnet Labs. It is scalable, secure and simple to configure. In this tutorial, we will show you how to install NSD on a Fedora server.
Before you start, ensure that you have the following:
First and foremost, update the system packages to the latest version available by running the following command:
$ sudo dnf update -y
Next, we will install NSD by running the following command:
$ sudo dnf install nsd -y
After installation, the NSD configuration files will be located in the /etc/nsd/
directory.
Open the nsd.conf
file using your preferred text editor:
$ sudo nano /etc/nsd/nsd.conf
You should now see the contents of the configuration file. Uncomment the following directives:
server:
hide-version: yes
username: nsd
zonesdir: "/etc/nsd"
Create a new zone file in the /etc/nsd
directory. Replace example.com
with your domain name.
$ sudo touch /etc/nsd/example.com.zone
Add the following content to the file:
; Example Zone File
$ORIGIN example.com.
$TTL 86400
@ IN SOA ns1.example.com. admin.example.com. (
2020082001 ; serial number
3600 ; refresh
1800 ; retry
604800 ; expire
86400 ; minimum TTL
)
IN NS ns1.example.com.
IN NS ns2.example.com.
ns1 IN A 192.168.0.1
ns2 IN A 192.168.0.2
To verify that the NSD configuration is correct, run the following command:
$ sudo nsd-checkconf /etc/nsd/nsd.conf
The output should be similar to the following:
ok
Once the configuration is verified, start the NSD service by running the following command:
$ sudo systemctl start nsd
You should see no output if the service starts successfully.
Configure the NSD service to start automatically at boot time by running the following command:
$ sudo systemctl enable nsd
To test if NSD is installed and functioning correctly, run the following command:
$ dig NS example.com +short @localhost
This should return output similar to the following:
ns1.example.com.
ns2.example.com.
Congratulations! You have successfully installed and configured NSD on your Fedora 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!