Shashikant shah

Thursday 30 August 2012

Configuration Master and Slave BIND (DNS)


-->

            MASTER DNS SERVER
                                 
1.Required RPM

#bind-libs-9.3.3-10.el5
#bind-chroot-9.3.3-10.el5
#bind-devel-9.3.3-10.el5
#bind-utils-9.3.3-10.el5
#bind-libbind-devel-9.3.3-10.el5
#bind-9.3.3-10.el5
#bind-sdb-9.3.3-10.el5
#caching-nameserver-9.3.3-10.el5

2.Some file check

# vim /etc/hosts
# vim /etc/sysconfig/network
# vim /etc/resolv.conf

3.Configure

# cp -p /etc/named-caching-nameserver.conf /var/named/chroot/etc/named.conf

4.Soft link

# ln -s /var/named/chroot/etc/named.conf /etc/named.conf

5.Check Permission

# ll -ld /etc/named.conf
root named named.conf

6.Create named.conf

#vim /etc/named.conf

listen-on Port 53 { 127.0.0.1; Server IP; } ;

allow-query { localhost; any; } ;
allow-query-cache { localhost; any; } ;

match-clients { localhost; any; } ;
match-destinations { localhost; any; } ;

recursion yes;
zone “example.com” {
type master;
file “example.com.zone”;
allow-transfer { slave IP; };
allow-update { slave IP; };
};
zone “0.168.192.in-addr.arpa” {
type master;
file “rev-example.com.zone”;
allow-transfer { slave IP; };
allow-update { slave IP; };
};

7.Test named.conf

# named-checkconf

cd /var/named/chroot/var/named/

# cp -p localdomain.zone example.com.zone

NOTE- Any update in master DNS server file example.com.zone or rev-example.com.zone file after
that change the serail number.

# vim example.com.zone

$TTL 86400

@ SOA master.example.com root.example.com. (

42                 ; serial (d. adams)

3H                ; refresh

15M             ; retry

1W               ; expiry

1D )             ; minimum

IN NS master.example.com.
IN NS slave.example.com.

master IN A 192.168.0.254
slave IN A 192.168.0.1
client2 IN A 192.168.0.2

# cd /var/named/chroot/var/named/

# cp -p named.local rev-example.com.zone

# vim rev-example.com.zone

$TTL    86400
@       IN      SOA     master.example.com.  root.master.example.com.  (
                                      42            ; Serial
                                      28800      ; Refresh
                                      14400       ; Retry
                                      3600000   ; Expire
                                      86400 )     ; Minimum

           IN     NS      master.example.com
           IN    NS       slave.example.com

254       IN     PTR   master.
1         IN     PTR     slave.
2         IN     PTR     client2.

# service named restart
# chkconf named on

                       SLAVE DNS SERVER
* All Package install
 
8.Copy to file
# cp /var/named/chroot/etc/named.caching-nameserver.conf   /var/named/chroot/etc/named.conf
 
9.Check Permission
 # cd  /var/named/chroot/etc/
 
# ll  -ld 
  root  named  named.conf
 
10.Edit some line
 
# vim named.conf
listen-on Port 53 { 127.0.0.1; Slave IP; } ;
allow-query { localhost; any; } ;
allow-query-cache { localhost; any; } ;
zone “example.com” {
type slave;
file “slaves/example.com.zone”;
allow-update { none; };
masters { master IP; };
};

zone “0.168.192.in-addr.arpa” {
type slave;
file “slaves/rev-example.com.zone”;
allow-update { none; };
masters { master IP; };
};
11.Check Permission
# cd  /var/named/chroot/var/named
# chown -R  root:named  slaves
# ls -ld  /var/named/slaves (777) 
#  cd /var/named/chroot/var
# chown -R root:named named 
# ls -ld  /named (755)
# service network restart
# service named restart
# chkconfig named on 
12.check DNS
# nslookup
# dig server.example.com

No comments:

Post a Comment