DNS Server With nsd on Debian Linux
Although i’m still using Cloudflare as DNS Server, i also run my own dns server with nsd.
nsd Setup on Debian Linux
Install nsd with apt.
$ sudo apt install nsd
Usually nsd’s configuration are stored on /etc/nsd. There is a
nsd.conf that heart of nsd’s configuration.
You can follow what i did and dont forget to adjust to your needs.
$ sudo vim /etc/nsd/nsd.conf
---
server:
ip-address: 103.74.5.58 servers=1 bindtodevice=yes setfib=1
port: 53
username: nsd
server-count: 1
hide-version: yes
identity: ""
zonesdir: "/etc/nsd"
debug-mode: yes
database: ""
tcp-count: 1000
tcp-timeout: 3
tcp-reject-overflow: yes
remote-control:
control-enable: yes
control-interface: /var/run/nsd/nsd.sock
zone:
name: "laskarnix.org"
zonefile: "laskarnix.org.zone"
Save the file and you have to create your own .zone like mine. Here is my zone.
$ORIGIN laskarnix.org.
laskarnix.org. 3600 SOA ns1.laskarnix.org. webmaster.laskarnix.org ( 2025020301 1800 3600 86400 3600 )
86400 IN NS ns1
3600 IN A 103.74.5.58
3600 IN MX 10 mail
ns1 3600 IN A 103.74.5.58
Start the nsd service.
$ sudo service nsd start
Finally, open you domain management on the registrar. Then, find a Glue Records
and add ns1.your-domain.com and nameserver’s IP.