Friday, 4 October 2013

How to configure slave dns server

Configuration on Master DNS

[root@upload named]# cat /etc/named.conf

options {
        listen-on port 53 { 127.0.0.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; 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 /var/named/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

[root@upload named]# rndc reload

Configuration on Slave DNS

[root@upload2 named]# cat /etc/named.conf

options {
    listen-on port 53 { 127.0.0.1; };
    #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; any; };
    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" IN {
        type slave;
        masters { 10.66.191.230; };
        file "slaves/zumi.com.zone";
        notify no;
    };

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

[root@upload2 etc]# service named start
Generating /etc/rndc.key:                                  [  OK  ]
Starting named:                                            [  OK  ]
[root@upload2 etc]# rndc reload
server reload successful
[root@upload2 etc]# ls /var/named/slaves/
zumi.com.zone

No comments:

Post a Comment