September 2019
M T W T F S S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Categories

WordPress Quotes

Nothing can stop the man with the right mental attitude from achieving his goal; nothing on earth can help the man with the wrong mental attitude.
Thomas Jefferson
September 2019
M T W T F S S
« Aug    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

Short Cuts

2012 SERVER (64)
2016 windows (9)
AIX (13)
Amazon (40)
Ansibile (19)
Apache (135)
Asterisk (2)
cassandra (2)
Centos (211)
Centos RHEL 7 (268)
chef (3)
cloud (2)
cluster (3)
Coherence (1)
DB2 (5)
DISK (25)
DNS (9)
Docker (30)
Eassy (11)
ELKS (1)
EXCHANGE (3)
Fedora (6)
ftp (5)
GIT (3)
GOD (2)
Grub (1)
Hacking (10)
Hadoop (6)
health (1)
horoscope (23)
Hyper-V (10)
IIS (15)
IPTABLES (15)
JAVA (7)
JBOSS (32)
jenkins (1)
Kubernetes (7)
Ldap (5)
Linux (188)
Linux Commands (166)
Load balancer (5)
mariadb (14)
Mongodb (4)
MQ Server (24)
MYSQL (84)
Nagios (5)
NaturalOil (13)
Nginx (35)
Ngix (1)
openldap (1)
Openstack (6)
Oracle (35)
Perl (3)
Postfix (19)
Postgresql (1)
PowerShell (2)
Python (3)
qmail (36)
Redis (12)
RHCE (28)
SCALEIO (1)
Security on Centos (29)
SFTP (1)
Shell (64)
Solaris (58)
Sql Server 2012 (4)
squid (3)
SSH (10)
SSL (14)
Storage (1)
swap (3)
TIPS on Linux (28)
tomcat (62)
Uncategorized (30)
Veritas (2)
vfabric (1)
VMware (28)
Weblogic (38)
Websphere (71)
Windows (19)
Windows Software (2)
wordpress (1)
ZIMBRA (17)

WP Cumulus Flash tag cloud by Roy Tanck requires Flash Player 9 or better.

Who's Online

30 visitors online now
4 guests, 26 bots, 0 members

Hit Counter provided by dental implants orange county

Master Slave DNS Server on CentOS 6 and RHEL

How to Setup Master Slave DNS Server on CentOS 6 and RHEL

The DNS ( Domain Name System ) is a distributed system, used for transalate domain names to IP and vice a versa. This article will help you to How to Setup Master Slave DNS Server on CentOS 6 and RHEL Systems.

Network Scenario for this Setup:

Master DNS Server IP: 192.168.1.10 ( ns1.rmohan.net )
Slave DNS Server IP: 192.168.1.11 ( ns2.rmohan.net )
Domain Name : rmohan.net ( For Testing Purpose )
Domain IP : 192.168.1.50 ( For Testing Purpose )
Step 1: Install Required RPMS ( at Master and Slave Both )

Install bind packages at both Master and Slave dns servers using following commands.

# yum install bind bind-chroot
Step 2: Setup Master (NS1) DNS Server

There are two types of configuration files in DNS.

One is main dns configuration files named “named.conf”
Another type of configuration file are called zone file. Which is individually created for all domains. named.conf keeps an entry for all zone files.
2.1 Configure named.conf using below configuration

# vim /var/named/chroot/etc/named.conf
Content of named.conf:

// /var/named/chroot/etc/named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.1.0/24; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { localhost; 192.168.1.0/24; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file “/etc/named.iscdlv.key”;

managed-keys-directory “/var/named/dynamic”;
};

logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};

zone “.” IN {
type hint;
file “named.ca”;
};

zone “rmohan.net” IN {
type master;
file “/var/named/rmohan.net.db”;
allow-update { none; };
};

include “/etc/named.rfc1912.zones”;
2.2 Create a zone file for you domain “rmohan.net”

# vim /var/named/chroot/var/named/rmohan.net.db
Content of zone file:

; Zone file for rmohan.net
$TTL 14400
@ 86400 IN SOA ns1.rmohan.net. webmaster.rmohan.net. (
3215040200 ; serial, todays date+todays
86400 ; refresh, seconds
7200 ; retry, seconds
3600000 ; expire, seconds
86400 ) ; minimum, seconds

rmohan.net. 86400 IN NS ns1.rmohan.net.
rmohan.net. 86400 IN NS ns2.rmohan.net.
rmohan.net. IN A 192.168.1.100
rmohan.net. IN MX 0 rmohan.net.
mail IN CNAME rmohan.net.
www IN CNAME rmohan.net.

 

2.3 Add more domains in dns server.
To add more domains in dns, create zone files individually for all domain as above. After that add any entry for all zones in named.conf like below. Change rmohan.net with your domain name.

zone “rmohan.net” IN {
type master;
file “/var/named/rmohan.net.db”;
allow-update { none; };
};
Step 2.4: Start named service .
Start named (bind) service using following command and setup auto start on system boot.

# /etc/init.d/named restart
# chkconfig named on
Step 3: Setup Slave (NS2) DNS Server

At slave dns server you need to update named.conf file only. All zone files will automatically synced from master dns server. Any changes done on Master will reflect on slave after a specified time interval.

3.1 Configure named.conf using below configuration

# vim /var/named/chroot/etc/named.conf
Content of named.conf:

// /var/named/chroot/etc/named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.1.0/24; };
listen-on-v6 port 53 { ::1; };
directory “/var/named”;
dump-file “/var/named/data/cache_dump.db”;
statistics-file “/var/named/data/named_stats.txt”;
memstatistics-file “/var/named/data/named_mem_stats.txt”;
allow-query { localhost; 192.168.1.0/24; };
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file “/etc/named.iscdlv.key”;

managed-keys-directory “/var/named/dynamic”;
};

logging {
channel default_debug {
file “data/named.run”;
severity dynamic;
};
};

zone “.” IN {
type hint;
file “named.ca”;
};

zone “rmohan.net” IN {
type slave;
file “slaves/rmohan.net.db”;
masters { 192.168.1.90; };
};

include “/etc/named.rfc1912.zones”;
Step 3.2: Start named Service
Start named (bind) service using below command.

# /etc/init.d/named restart
# chkconfig named on
After restarting named service, Check zone files on slave dns server at /var/named/chroot/var/named/slaves/.

Step 4: Finally Test Your DNS Setup.

Query to your Master and Slave DNS Server directly using following commands, You will get the same resonse from both servers.
Syntax: nslookup <domainname.com> <dns server name/ip>

Query to Master DNS Server:

# nslookup rmohan.net 192.168.1.10

Server: 192.168.1.10
Address: 192.168.1.10#53

Name: rmohan.net
Address: 192.168.1.100
Query to Slave DNS Server:

# nslookup rmohan.net 192.168.1.11

Server: 192.168.1.11
Address: 192.168.1.91#53

Name: rmohan.net
Address: 192.168.1.50
Above outputs is showing that dns server has successfully resolved domain rmohan.net from master and slave dns servers.

 

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

  

  

  

Blue Captcha Image
Refresh

*

Protected by WP Anti Spam