BACK

Configuring a BIND 8.x Domain Name Server

This HowTo will concentrate on configuring a DNS server on a Linux computer using BIND 8.x.  The domain will be a ficticous one called solarr.com and the IP range will be in the 192.168.1.XXX range with a /27 subnet mask -this is one of the IP address ranges set aside for private networks as Internet Routers won't forward these packets.  You should replace all references to these with your own IP addresses and your own domain and hostnames.  To configure a name server you need a configuration file called named.conf in the /etc directory, several zone files in /var/named, and a cache file.  The section of the network that the name server is responsible for is called a zone.  A zone isn't the same as a domain as you may have several zones in a domain with each zone having its own name server.   You could also have one Name Server hosting multiple zones; each with its own zone file.   The zone file hold records for IP address to hostname associations.  The cache file holds the records for the root servers that your server connects to.  And finally the hosts for your zone will refer to the /etc/resolv.conf file for the IP address of the zone's name server.  Before you can start configuring your name server you need to verify that it is installed.


named.conf

named.conf is located in the /etc directory and is the main configuration file for the Name Server daemon named.  It uses C Language comments such as // and  /* Commented text inside here */.   Below is an example of a zone in named.conf (color-coded).

zone "solarr.com"IN {

type master ;


file "solarr.com" ;


};

The zone command comes first.  Next is the zone name After that is the class IN for Internet.  Then the opening brace {

The second line contains the entry for the zone type;

The third line contains the filename for the zone.

and lastly the closing brace };

Besides zone files there are other things that go in the named.conf file.  Some of these are server, acl, logging, and directory.  The server statement defines the characteristics to be associated with a remote name server.  The acl statement is used to control access by other hosts.  The logging statement is used to configure logging options such as the maximum log file size and the severity level for messages.  The directory option specifies where the zone and cache files are located (/var/named/ directory for this HowTo).  


Caching Only Name Server

 Uses the files named.conf, root.hint and 127.0.0.zone


Fictional solarr.com Name Server

First is the named.conf located in /etc file.   The files referenced in named.conf are root.hint, 127.0.0.zone, localhost.zone, named.192.168.1, and named.solarr.com. The root.hint and 127.0.0.zone files are also part of the caching only name server.

DNS FILES
Files located in /etc
named.conf
Files located in /var/named
root.hint and 127.0.0.zone
localhost.zone
named.192.168.1, and named.solarr.com.

The named daemon is in the /usr/sbin directory (if not try the /sbin or /bin directories or consult you distribution's documentation).   The daemon should be started every time the computer starts and enters into the correct run level which supports full networking support (run level 2 or 3 depending on your distribution of Linux).  To get named to start at the correct runlevel, you will need to place a script in the /etc/rc.d directory and place a symbolic link ( ln  -s  /etc/rc.d/named   S10named) to it in the correct rc#.d directory (the # will be the full network support runlevel).  You will need to make the script /etc/rc.d/named executable ( chmod 744 named ).  If you already have a script called /etc/rc.d/named and a symbolic link in the correct run level then you won't need to add one, you should still concatenate it to see if it is starting the correct daemons from the correct locations.  Else try putting this script in /etc/rc.d and call it named.

After all the files are installed you will need to start the Name Server whichever one you created either the caching only or the full zone name server.  To start the daemon enter the command:  ndc start.   To restart the daemon enter the command:  ndc restart.
BACK