Installing and Configuring the BIND DNS Server


DNS service is crucial for your server if you wish for it to be accessed from the Internet. The reason for this is that domain names are much easier to type for users, and easier to remember. Thus, you need a DNS server if you plan on having Internet users connect to your server. The standard DNS server is the Berkeley Internet Name Domain (BIND). BIND is available through the Internet Software Consortum, or ISC at In addition, BIND should be available through your distribution. In the case of BIND, I would recommend downloading the packages through your distribution’s website. Before you may use a domain name, you must first register it, which there are several services available to register domain names. Once installed, you should then edit /etc/named.conf, and add the following information to it:

zone &#8220;; {<br /> type master;<br /> file &#8220;desireddomain.db&#8221;;<br /> };

You will of course replace the “desireddomain” strings as appropriate with your new domain name. This entry tells the named service that this server is the master server (with DNS, 2 DNS servers are required, for redundancy). Now then, we will now create the “desireddomain.db” file, which should be placed in the working directory of named, which is specified in the beginning of /etc/named.conf. In this file, we should place the following information:

IN SOA (<br /> 1000000; Serial<br /> 10800 ; Refresh &#8211; 3 hours<br /> 3600 ; Retry &#8211; 1 hour<br /> 86400 ; Expire &#8211; 24 hours<br /> 3600 ) ; Minimum &#8211; 1 hour</p> <p>IN NS</p> <p>www IN A ipaddressofwebserver<br /> ftp IN A ipaddressofftpserver<br /> smtp IN A ipaddressofmailserver

This should be saved in the directory specified in the first few lines of /etc/named.conf. Now, we will configure a secondary DNS server, or a slave DNS server. This is much easier than setting up the primary/master server. The only file to change will be the /etc/named.conf on the secondary server. You should save the following in the /etc/named.conf file:

zone &#8220;; {<br /> type slave;<br /> file &#8220;desireddomain.db&#8221;;<br /> };

Now, we can grab the configuration file from the first server using a utility that comes with BIND, named-xfer. We will do this by entering:

named-xfer -z -f desireddomain.db -s 0 addressofprimarynameserver

This will copy the configuration file from the primary DNS server. BIND should start automatically, if not, you may start it with the following command (for most systems):

/etc/init.d/named start

You should allow somewhere between 24 and 48 hours for the DNS records to be updated once you move your DNS server from host to host. DNS is a great protocol, and makes our lives easier, by allowing us to be lazy (simply type a domain name instead of an IP).

Source by Christopher Pace

· · · · ·

Related Articles & Comments

Menu Title