FreeBSD DJBDNS: Tinydns Create a Zone File For Domain

How do I create a zone file for my domain under tinydns server?

You need to update /var/ file to define your zone. The DNS information in data file is nothing but a series of lines. Each line starts with a special character and continues with a series of colon-separated fields. Each line contains a ttl (time to live) specifying the number of seconds that the line’s DNS records may be cached. You may omit ttl and it will use the default value.

Sample Zone File For Domain

Edit /var/ file using a text editor such as vi, enter:
# vi /var/
Update it as follows:

#define ns for domain
#define mx for domain
#define A for ns1, ns2, mail01, mail02 and www for our dns

Save and close the file.

  • The first line defines an NS ( and for our domain
  • @ defines two mx records for domain with priority.
  • + defines A record for each host name.

To create binary dns database (data.cdb file) simply type make command (in /var/ directory itself):
# make
You can now test your setup using standard dns tools:
# host
You can also use djbdns client tool called dnsip to lookup IP addresses:
# dnsip

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

🐧 0 comments... add one

CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
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 jobs killall kill pidof pstree pwdx time
Searchinggrep 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
0 comments… add one

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