How to Install NSD on POP! OS Latest

NSD (Name Server Daemon) is an authoritative DNS server that provides high performance and low memory usage. It is designed to be simple and easy to configure. In this tutorial, we will guide you through the process of installing NSD on POP! OS latest version (21.04).

Prerequisites

Before you begin, ensure that you have the following prerequisites:

Step 1: Update the System

Before we begin the installation of NSD on POP! OS, we need to update the system to its latest version. To do that, run the following command:

sudo apt update && sudo apt upgrade

Step 2: Install NSD

Now we are ready to install NSD. To do that, run the following command:

sudo apt install nsd

This will install the latest version of NSD on your system.

Step 3: Configure NSD

Next, we need to configure NSD. The main configuration file for NSD is located at /etc/nsd/nsd.conf. Open this file using your favourite text editor:

sudo nano /etc/nsd/nsd.conf

Now, you can edit the configuration file to match your requirements. Here is the basic configuration that you can use as a starting point:

server:
    hide-version: yes
    ip-address: 0.0.0.0
    port: 53
    do-ip4: yes
    do-ip6: no
    database: "/var/lib/nsd/nsd.db"
    pidfile: "/run/nsd/nsd.pid"
    zonesdir: "/etc/nsd/zones"

zone:
    name: "example.com"
    zonefile: "example.com.zone"

This configuration sets NSD to listen on all IP addresses, on port 53. It also sets the database and pidfile locations.

You should replace example.com with your own domain name, and /etc/nsd/zones/example.com.zone with the path to your zone file.

Step 4: Create the Zone File

Now we need to create the zone file for our domain. The zone file is located at /etc/nsd/zones/example.com.zone (replace example.com with your domain name).

Here is an example zone file:

$ORIGIN example.com.
$TTL 86400
@ IN SOA ns1.example.com. admin@example.com. (
        2021112001 ; serial
        7200 ; refresh
        3600 ; retry
        604800 ; expire
        86400 ; minimum
)
@ IN NS ns1.example.com.
ns1 IN A 192.168.0.10
www IN A 192.168.0.10

This zone file sets the TTL (Time To Live) to 86400 seconds, and defines the domain name servers: ns1.example.com and www.example.com. You should replace these with your own domain name servers and IP addresses.

Step 5: Start NSD

Now we are ready to start NSD. To do that, run the following command:

sudo systemctl start nsd

To enable NSD to start automatically at boot time, run the following command:

sudo systemctl enable nsd

To check the status of NSD, run the following command:

sudo systemctl status nsd

If everything is set up correctly, you should see a message indicating that NSD is running and listening on port 53.

Conclusion

Congratulations! You have successfully installed and configured NSD on POP! OS latest version. You should now be able to use NSD to host your own 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!