Install and Configure Master and Slave DNS Servers on CentOS 6.4

Assume the master server’s IP is 192.168.1.2, and the slave server’s IP is 192.168.1.3.

Before you start, make sure you have installed caching only DNS server on both the master and slave servers.  Refer to this post for caching only server installation and configuration.  Then configure the master server to act an authoritative DNS server as stated in my past post.

For master server:

# vi /var/named/chroot/etc/named.conf

add the following:

allow-transfer { localhost; 192.168.2.3; };

For slave server:

Configure Slave DNS Server

# vi /var/named/chroot/etc/named.conf

change:
recursion yes;

to:
recursion no;

Edit zone definition:

zone “companycloud.com” IN {
type slave;
file “slaves/companycloud.com”;
masters { 192.168.1.2; };
};

zone “1.168.192.in-addr.arpa” IN {
type slave;
file “slaves/1.168.192.db”;
masters { 192.168.1.2; };
};

For both master and slave server:
# vi /etc/resolv.conf

Edit according to this:
nameserver 127.0.0.1

# service named restart

Check on Slave server:

# cd /var/named/chroot/var/named/slaves
# ls -l

Check if all the data zone files show up correctly.
You can use dig command to see if the DNS servers are working correctly.

Advertisements
This entry was posted in Linux Admin Basics. Bookmark the permalink.

One Response to Install and Configure Master and Slave DNS Servers on CentOS 6.4

  1. Ravi says:

    Hi Simon I have been following your blog on Install and Configure Master and Slave DNS Servers on CentOS 6.4 I have read carefully. In order to test on real domain local IP address is replaced with WAN IP address. In your case companycloud.db
    what other files need to be changed ?
    Thaks Ravi

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s