Search tutorial by keyword

How to Install BIND on CentOS

 

In this article we will show you how can you configure Bind DNS server on your Linux server but there is one condition leading to the installation of BIND is that you need at least two servers to run your nameserver. This is the requirement as we will give you a configuration tutorial for Master and Slave DNS server.

 

First step is to install BIND on your Master server 

#yum install bind bind-utils

Next step is to configure BIND by editing the named.conf file 

#vi /etc/named.conf

You have to change the IP address in the configuration file and the IP you will be using will be of your second server 

Allow-transfer{localhost,IP_Address_Of_Second_Server}

Next Step is to add a zone in the same file which we are editing 

Let’s suppose the domain is “michael.com”

zone "michael.com" IN {

                type master;

                file "michael.com.zone";

                allow-update { none; };

        };

Next step is to Zone file only with the name you have specified in named.conf file. So we will be using the following command to make it

#vi /etc/named/michael.com.zone

Lets suppose the IP’s

192.168.21.1 First Server

192.168.21.2 Second Server

192.168.21.3 Third Server

 

In this file we will add the IP’s of our first second and third server 

$TTL 86400

@   IN  SOA     ns1.michael.com. root.michael.com. (

        2013042201  ;Serial

        3600        ;Refresh

        1800        ;Retry

        604800      ;Expire

        86400       ;Minimum TTL

)

; Specify our two nameservers

IN   NS   ns1.michael.com.

IN   NS   ns2.michael.com.

; Resolve nameserver hostnames to IP, replace with your two server IP addresses.

ns1   IN   A   192.168.21.1

ns2   IN   A   192.168.21.2

 

; Define hostname -> IP pairs which you wish to resolve

@   IN   A   192.168.21.3

www   IN   A   192.168.21.3

 

Now you have to start named service by following command

/etc/init.d/named start

To check that your master server has been successfully configured use the following command to check it

This email address is being protected from spambots. You need JavaScript enabled to view it..1 michael.com

You will get answer and authority section in result of the above command

 

Now comes the turn of Slave Server

Same steps for installation as we have done on master server

#yum install bind bind-utils

Next step is to configure BIND by editing the named.conf file 

#vi /etc/named.conf

Just there will be a change in slave server that we will be delete the “Allow-transfer” line from the config file

Now we will add a zone also in named.conf file but we will change the type to slave 

zone "michael.com" IN {

                type slaver;

                file "michael.com.zone";

                allow-update { none; };

        };

Now start the named service 

#/etc/init.d/named start

This email address is being protected from spambots. You need JavaScript enabled to view it..2 michael.com

Answer and authority section should be returned as a result

Last modified onTuesday, 07 April 2015 13:51
Michael Dudli

Cloud Specialist with more than 10 years experience in the Hosting Business.

Website: www.cloudserver24.com

Contact

Sales

sales@cloudserver24.com

Support

support@cloudserver24.com