FreeBSD DJBDNS: Create Secondary TinyDNS Server

htt‮.www//:sp‬lautturi.com
FreeBSD DJBDNS: Create Secondary TinyDNS Server

To create a secondary TinyDNS server using DJBDNS on a FreeBSD system, you will need to do the following:

  1. Install DJBDNS on your FreeBSD system. You can install DJBDNS using the pkg package manager:
# pkg install djbdns
  1. Create a user and group for the TinyDNS server to run under. You can do this using the pw command:
# pw groupadd tinydns
# pw useradd tinydns -g tinydns -d /usr/local/tinydns -s /nonexistent -w no
  1. Set up the directories and configuration files for TinyDNS. Run the following commands to create the necessary directories and files:
# mkdir -p /usr/local/tinydns/secondary/data
# mkdir /usr/local/tinydns/secondary/log
# cd /usr/local/tinydns/secondary
# touch log/main
# touch log/status
# touch data/data.cdb
# cp /usr/local/djbdns/tinydns-data/secondary/Makefile .
  1. Set up the DNS data for TinyDNS. You will need to create a DNS data file that specifies the DNS records for your domain. This file should be in a specific format, as described in the TinyDNS documentation. You can use the tinydns-data utility to generate this file from a template.

  2. Run the make command to compile the DNS data file and create the necessary database files:

# cd /usr/local/tinydns/secondary
# make
  1. Set up the TinyDNS daemon to start at boot time. You can do this by adding the following line to the /etc/rc.conf file:
tinydns_secondary_enable="YES"
  1. Start the TinyDNS daemon:
# service tinydns-secondary start
  1. Test the configuration by querying the TinyDNS server using the dig command:
# dig @localhost example.com

This should return the DNS records for the domain example.com.

For more information about configuring and using the DJBDNS TinyDNS server, you can refer to the DJBDNS documentation.

Created Time:2017-10-28 20:40:33  Author:lautturi