FreeBSD Install DJBDNS Server

djbdns’s tinydns server is one of the second most popular DNS server with security in mind. How do I install DJBDNS server under FreeBSD operating systems?

DJBDNS is a collection of Domain Name System tools. It includes several components:

  1. The tinydns program is a fast, UDP-only DNS server.
  2. The axfrdns program is a fast, TCP-only DNS server. This is useful for transferring zones to secondary name server or bind server.
  3. The dnscache program is a local DNS cache. It accepts recursive DNS queries from local clients such as web browsers. It collects responses from remote DNS servers.

Sample Configuration Setup - -

Install DJBDNS on

Type the following command:
# portsnap fetch update
# cd /usr/ports/dns/djbdns
# make install clean && rehash

Make sure you select IPv6 patch if you need to provide AAAA dns address for your domain.

Fig.01: FreeBSD Install djbdns Software via Ports

This port will also install the following two required software:

  • daemontools: Service monitoring and logging utilities by djbdns (and qmail) server
  • ucspi-tcp2 : Command-line tools for building TCP client-server application

DJBDNS Files and Directories

  1. tinydns: a database-driven dns server – It will open UDP port 53
  2. axfrdns: a zone-transfer server – It will open TCP port 53
  3. /var/service: The directory containing the various service directories to be monitored. The author ( Daniel J. Bernstein) recommends /service, but the FreeBSD port has a default of /var/service instead, which is consistent with the FreeBSD filesystem hierarchy.
  4. /var/ : Your zone configuration directory. It will be symlinked to /var/service
  5. rsync or scp : Update your zone files on server.
  6. tinydns-conf : sets up a DNS publication service (master name server)
  7. axfrdns-conf : sets up a DNS zone-transfer service
  8. /usr/local/etc/rc.d/ : daemontools rc.d start / stop / restart script. Use this to start or stop djbdns server.

🐧 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
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig 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
1 comment… add one
  • sims Jul 8, 2009 @ 23:37

    Cool article and all. I just though to mention that you can’t have more than one second anything. If it comes before it’s first – after and it’s third. ;)

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @