Master and Slave name server installation and configuration

Master and Slave name server installation and configuration  steps.

The Domain Name System (DNS) is a hierarchical naming system built on a distributed database for computers, services, or any resource connected to the Internet or a private network. It  includes various information with domain names assigned to each of the entities which are participating in it. Most importantly, it translates domain names meaningful to humans into the numerical identifiers associated with networking equipment for the purpose of locating and addressing these devices worldwide. BIND (Berkeley internet name domain) is one of the most widely used DNS servers; it comes standard in most Unix like operating systems.

Forward lookup zone: IP Address to hostname

Reverse lookup zone: hostname to IP Address

DNS Master: Read / Write copy

DNS Slave: Read only copy

Let us see the steps of Master and Slave name server installation and configuration one by one.

Step 1: Bind DNS master installation and configuration

Step 2: Bind DNS slave installation and configuration

Let us see the steps in detail:

Master & Slave DNS installation and configuration on Centos steps

Dependencies:

Centos Box: 2 No’s (Virtual / Physical)

Packages: bind-libs-9.8.2-.17.rc1.el6_4.6.x86_64,bind-9.8.2-0.17.rc1.el6_4.6.x86_64,bind-utils-9.8.2-0.17.rc1.el6_4.6.x86_64

Name server installation and configuration guide has prepare on following platform and services.

Operating System       : Centos release 6.4 (Final) 64bit

Domain Name             : demo.com

Master                            : ns1.demo.com, 192.168.0.101 (static)

Slave                              : ns2.demo.com, 192.168.0.102 (static)

Step 1: Bind DNS master installation and configuration

Login as root user to master node 192.168.0.101

1.1   Install bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6 from repository using yum command line utility

# yum install bind

Dependencies Resolved

============================================================================
Package          Arch        Version                           Repository         Size
============================================================================
Installing:
bind             x86_64      32:9.8.2-0.17.rc1.el6_4.6         base      4.0 M
Installing for dependencies:
portreserve      x86_64      0.0.4-9.el6                       base       23 k
Updating for dependencies:
bind-libs        x86_64      32:9.8.2-0.17.rc1.el6_4.6         base      878 k
bind-utils       x86_64      32:9.8.2-0.17.rc1.el6_4.6         base      182 k
Transaction Summary
==========================================================================
Install       2 Package(s)
Upgrade       2 Package(s)
Total download size: 5.0 M
Is this ok [y/N]:y

1.2  Modify hostname as ns1.demo.com     in (/etc/sysconfig/network)

# vi /etc/sysconfig/network

NETWORKING=yes

HOSTNAME=ns1.demo.com

Save & Exit (:wq!)

1.3   Add host entry ns1.demo.com    in (/etc/hosts)

# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4

::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.101 ns1.demo.com ns1

Save & Exit (:wq!)

1.4 Add name server IP address in (/etc/resolv.conf)

# vi /etc/resolv.conf

; generated by /sbin/dhclient-script

search demo.com

nameserver 192.168.0.101

nameserver 192.168.0.102

Save & Exit (:wq!)

1.5   Edit named.conf file located in /etc/named.conf

#vi /etc/named.conf

options {

listen-on port 53 { 127.0.0.1;192.168.0.101; };
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.0.0/23 };
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 “demo.com” in {
type master;
file “fwd.demo.com”;
allow-update {none;};
};

zone “0.168.192.in-addr.arpa” in {
type master;c
file “0.168.192.in-addr.arpa”;
allow-update {none;};
};

include “/etc/named.rfc1912.zones”;
include “/etc/named.root.key”;
Save & Exit (:wq!)
#cd  /var/named/

#pwd

/var/named

1.6 Create a file and add the following block

#vi fwd.demo.com

$ORIGIN demo.com.
$TTL 1d
@ IN SOA ns1.demo.com.  support.demo.com. (
2010031500 ; se = serial number
3h ; ref = refresh
15m ; ret = update retry
3w ; ex = expiry
3h ; min = minimum
)

IN A 192.168.0.101
IN A 192.168.0.102
IN NS ns1
IN NS ns2
IN MX 10 mail.demo.com.

ns1 IN A 192.168.0.101
ns2 IN A 192.168.0.102
mail IN A 192.168.0.25

Save & Exit (:wq!)

# vi  0.168.192.in-addr.arpa 

@ IN SOA ns1.demo.com. support.solutionsatexperts. (
2010031500 ; se = serial number
3h ; ref = refresh
15m ; ret = update retry
3w ; ex = expiry
3h ; min = minimum
)

IN NS ns1.demo.com.
IN NS ns2.demo.com.

101 IN PTR ns1.demo.com.
102 IN PTR ns2.demo.com.(192.168.0.102)
25 IN PTR mail.demo.com.(192.168.0.25)

Save & Exit (:wq!)

#service named restart

Step 2: Bind DNS slave installation and configuration

2.1  Login as root user to slave node 192.168.0.102

Install bind.x86_64 32:9.8.2-0.17.rc1.el6_4.6 from repository using yum command line utility

# yum install bind

2.2  Modify hostname as ns2.demo.com in (/etc/sysconfig/network)

# vi /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=ns2.demo.com

Save & Exit (:wq!)

2.3  Add host entry ns2.demo.com  in (/etc/hosts)

# vi /etc/hosts

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1               localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.0.102 ns2.demo.com ns2

Save & Exit (:wq!)

2.4  Add nameserver IP address in (/etc/resolv.conf)

# vi /etc/resolv.conf

search demo.com
nameserver 192.168.0.102
nameserver 192.168.0.101

2.5  Edit named.conf file located in /etc/named.conf

# vi /etc/named.conf
options {
listen-on port 53 { 127.0.0.1;192.168.0.102; };
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.0.0/23; };
allow-transfer {192.168.0.0/23;};
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 “demo.com” in {
type slave;
file “slaves/fwd.demo.com”;
masters {192.168.0.101;};
allow-transfer {192.168.0.0/23;};
};

zone “0.168.192.in-addr.arpa” in {
type slave;
file “slaves/0.168.192.in-addr.arpa”;
masters {192.168.0.101;};
allow-transfer {192.168.0.0/23;};
};

include “/etc/named.rfc1912.zones”;
include “/etc/named.root.key”;

Save & Exit (:wq!)

2.6  Following DNS zone files will be created for slave node in /var/named/slaves

# ls /var/named/slaves/

0.168.192.in-addr.arpa  fwd.demo.com

2.7   Verify DNS

# dig demo.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> demo.com

;; global options: +cmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 299

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 2, ADDITIONAL: 2

;; QUESTION SECTION:

;demo.com.                IN      A

;; ANSWER SECTION:

demo.com. 86400   IN      A       192.168.0.102
demo.com. 86400   IN      A       192.168.0.101

;; AUTHORITY SECTION:

demo.com. 86400   IN      NS      ns2.demo.com.
demo.com. 86400   IN      NS      ns1.demo.com.

;; ADDITIONAL SECTION:

ns1.demo.com. 86400 IN    A       192.168.0.101
ns2.demo.com. 86400 IN    A       192.168.0.102

;; Query time: 1 msec
;; SERVER: 192.168.0.101#53(192.168.0.101)
;; WHEN: ; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> demo.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 51969
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;demo.com.                IN      A
;; ANSWER SECTION:

demo.com. 600     IN      A       192.168.0.101
;; Query time: 0 msec
;; SERVER: 192.168.0.101#53(192.168.0.101)
;; WHEN: Thu Jan  2 18:30:58 2014
;; MSG SIZE  rcvd: 140

2.8  nslookup for verifying forward and reverse lookup zones (IP to Hostname and Hostname to IP)

# nslookup

> mail.demo.com

Server:         192.168.0.101
Address:        192.168.0.101#53
Name:   mail.demo.com

Address: 192.168.0.25

>

 # nslookup

> 192.168.0.25

Server:         192.168.0.101
Address:        192.168.0.101#53
25.0.168.192.in-addr.arpa       name = mail.demo.com.

>

2.9  Ping hostname

# ping mail.demo.com

PING mail.demo.com (192.168.0.25) 56(84) bytes of data.

64 bytes from mail.demo.com (192.168.0.25): icmp_seq=1 ttl=64 time=2.41 ms

^C

For more detail you can watch the video :

Both comments and pings are currently closed.

Comments are closed.

Copyright ©Solutions@Experts.com
Copyright © NewWpThemes Techmark Solutions - www.techmarksolutions.co.uk