Friday, 13 April 2012

How to configure Master DNS in rhel6.X / centos 6.X

[root@upload ~]# yum install bind*
[root@upload ~]# chkconfig named on
[root@upload named]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
10.66.191.230    upload    upload.zumi.com
10.66.191.221    upload2    upload2.zumi.com
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
[root@upload named]# cat /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=upload.zumi.com
DNSDOMAINNAME=zumi.com
[root@upload named]# cat /etc/named.conf


options {
        listen-on port 53 { any; };
        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     { 10.66.191.230; any; };
        allow-transfer { localhost; 10.66.191.221; };
        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 "zumi.com." {
       type master;
       file "zumi.com.zone";
       allow-update { none; };
};

zone "191.66.10.in-addr.arpa." {
      type master;
      file "191.66.10.in-addr.arpa.zone";
      allow-update { none; };
};

include "/etc/named.rfc1912.zones";
[root@upload named]# cat zumi.com.zone
$TTL    86400
@    IN      SOA   upload.zumi.com.  root.zumi.com. (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum            
             IN    NS             upload.zumi.com.
             IN    NS             upload2.zumi.com.
         IN       A          10.66.191.230
         IN       MX    1      upload.zumi.com
upload       IN    A              10.66.191.230
upload2         IN    A              10.66.191.221
imap         IN       CNAME          upload
pop         IN       CNAME          upload
pop3         IN       CNAME          upload
www         IN       CNAME          upload
smtp         IN       CNAME          upload
mail         IN       CNAME          upload
[root@upload named]# cat 191.66.10.in-addr.arpa.zone
$TTL    86400
@       IN     SOA     upload.zumi.com. root.zumi.com. (
                                      1997022700 ; Serial
                                      28800      ; Refresh
                                      14400      ; Retry
                                      3600000    ; Expire
                                      86400 )    ; Minimum

             IN     NS      upload.zumi.com.
          IN     PTR     zumi.com.   
230       IN     PTR     upload.zumi.com.
221       IN     PTR     upload2.zumi.com.

 [root@upload named]# service named restart
Stopping named: .                                          [  OK  ]
Starting named:                                            [  OK  ]
[root@upload named]# nslookup zumi.com
Server:        127.0.0.1
Address:    127.0.0.1#53

Name:    zumi.com
Address: 10.66.191.230

[root@upload named]# nslookup upload.zumi.com
Server:        127.0.0.1
Address:    127.0.0.1#53

Name:    upload.zumi.com
Address: 10.66.191.230

[root@upload named]# dig upload.zumi.com

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.10.rc1.el6 <<>> upload.zumi.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56812
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 1

;; QUESTION SECTION:
;upload.zumi.com.        IN    A

;; ANSWER SECTION:
upload.zumi.com.    86400    IN    A    10.66.191.230

;; AUTHORITY SECTION:
zumi.com.        86400    IN    NS    upload.zumi.com.
zumi.com.        86400    IN    NS    upload2.zumi.com.

;; ADDITIONAL SECTION:
upload2.zumi.com.    86400    IN    A    10.66.191.221

;; Query time: 1 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct  4 18:53:36 2013
;; MSG SIZE  rcvd: 101

[root@upload named]#

1 comment:

  1. bind* package is installed but there is no /etc/named* files in centos 5.3.
    Also while trying to view the status of named service: rndc: connect failed: 127.0.0.1#953: connection refused
    named is stopped
    is the outpur

    ReplyDelete