Details: Setting up Authoritative Domain Name Servers

Authoritative Domain Name Servers also are much harder to set up and configure than webservers.   As was the case for email, we again need to create two servers, a master server and a slave server, but in this case they both must have different fixed IPs.

Most of what I report here was based upon these two very clear and informative articles.

configure-master-bind-dns-server-on-ubuntu/
configure-slave-bind-dns-server-on-ubuntu/

You have to construct or configure three files on each server; the order in which you do this is unimportant.   On both the computer with the master name server and that with the slave nameserver, the first step on a Debian-based operating system is to install the bind9 program by issuing the command

sudo apt install bind9

Then enter the newly created /etc/bind directory by issuing the command "cd /etc/bind" without the quotes, and there edit or compose your three files.   The first step is to copy named.conf.local to named.conf.local.ori before you then modify the original.

The named.conf.local file on the computer serving as the master should look as below:

//
// Do any local configuration here
// Forward zone
   zone "domain.tld" {
         allow-update { none; }; 
   	 type master;
    	 file "/etc/bind/db.domain.tld";
	 allow-transfer { SLAVES_IP; };
	 };
//  Reverse zone
//   zone "31.244.81.in-addr.arpa" {
//   	 type master;
//    	 file "/etc/bind/db.REVIP.in-addr.arpa";
//	 allow-transfer { SLAVES_IP; };
//	 };
//	 
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

//logging {
  //  channel query.log {
    //    file "/var/log/query.log";
        // Set the severity to dynamic to see all the debug messages.
      //  severity dynamic;
  //  };
//};

where REVIP is the first three octets of the domain name's IP in reverse order separated by periods. In other words, if the domain's IP is A.B.C.D, the file name is db.C.B.A.in-addr.arpa.

This is a work in progress. I will update, correct, and finish it once everything has has been shown to work.