How do I setup primary dns name server using tinydns under FreeBSD operating systems?

You need to create a zone file for your domain which will provide the following data:

  1. Your name server IP address.
  2. Your mail server IP address and pointer to mx.
  3. Your AAAA and A records etc.

Step # 1: Create Directory For Your Zone File

Type the following command:
# mkdir /var/ns1.nixcraft.in

Step # 2: Set Up a DNS Publication Service

You need to use your IP 202.54.1.1 and directory /var/ns1.nixcraft.in as follows
# tinydns-conf tinydns dnslog /var/ns1.nixcraft.in 202.54.1.1
Above will create all required directories and default zone data file.

Step # 3: Start TinyDNS Server

Type the following command:
# ln -s /var/ns1.nixcraft.in /var/service/
Verify that UDP port # 53, opened:
# sockstat -4
# sockstat -4 -p 53

Now, all you’ve to do is create a zone file for your domain nixcraft.in.


🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 1 comment so far... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
1 comment… add one
  • Sam Jul 10, 2010 @ 7:31

    I am running FreeBSD 8. When following this guide I noticed a few things:

    Step 1 – Do not create the directory as it will conflict with Step 2.
    Step 2 – Use the directory in the command, if it exists, it won’t work. If it dosen’t exist, it will create it.

    Example:

    [root@vps ~]# mkdir /var/ns1.example.com
    [root@vps ~]# tinydns-conf tinydns dnslog /var/ns1.example.com 192.168.0.10
    tinydns-conf: fatal: unable to create /var/ns1.example.com: file already exists

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum