bind

http://www.system-act.com/server/bind.html
http://k4200.hatenablog.com/entry/20130304/1362379763







bind 超簡易版

http://www.eis.co.jp/engineers-notes/bind9_src_build

/etc/named.conf

http://www4.ueda.ne.jp/~zhongcun/linux32.html

/var/named/chroot/etc/named.conf

-------------------------
options {
        directory       "/var/named";
        allow-query     { any; };
        allow-transfer     { any; };ゾーン転送を無制限で許可
        recursion yes;
        version "";
};


view "local" {
        allow-query { any; };
        zone "." IN {
                type hint;
                file "named.ca";
        };

        zone "testdomain1" {
                type master;
                file "testdomain1.local.hosts";
                also-notify {192.168.11.19;} ;
                };

        zone "11.168.192.in-addr.arpa" IN {
                type master;
                file "192.168.11.0.local.rev";
                };

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

view "world" {
        match-clients { any; };
        allow-query { any; };
};
-------------------------


/var/named/chroot/var/named/testdomain1.local.hosts
-------------------------
$ttl 38400
@                 IN      SOA     LVS.testdomain1. root.LVS.testdomain1. (
                                  0000000001
                                  10800
                                  3600
                                  604800
                                  38400 )

testdomain1.      IN      NS      LVS.testdomain1.
testdomain1.      IN      MX      10 mail.testdomain1.
LVS.testdomain1.  IN      A       192.168.11.18
HTTP.testdomain1. IN      A       192.168.11.19
mail.testdomain1. IN      A       192.168.11.20
HTTP2.testdomain1. IN     CNAME   HTTP.testdomain1.
-------------------------

 

/var/named/chroot/var/named/192.168.11.0.local.rev
-------------------------
$ttl 38400
@               IN      SOA     LVS.testdomain1. root.testdomain1. (
                        1353762926
                        10800
                        3600
                        604800
                        38400 )

               IN      NS      LVS.testdomain1.
18             IN      PTR     LVS.testdomain1.
19             IN      PTR     HTTP.testdomain1.
-------------------------

 

 

/etc/resolv.conf
-------------------------
search localdomain example.com
nameserver 192.168.84.132
-------------------------

/etc/sysconfig/network
-------------------------
NETWORKING=yes
HOSTNAME=LVS.testdomain1
-------------------------


slave 側
-----------------------------------------------------------------
options {
        directory       "/var/named";
        allow-query     { any; };
        allow-transfer     { any; };ゾーン転送を無制限で許可
        recursion yes;
        version "";
};


view "local" {
        allow-query { any; };
        zone "." IN {
                type hint;
                file "named.ca";
        };

        zone "testdomain1" IN {
                type slave;
                file "slaves/testdomain1.local.hosts";
                masters {192.168.11.18;} ;
                };

        zone "11.168.192.in-addr.arpa" IN {
                type slave;
                file "slaves/192.168.11.0.local.rev";
                masters {192.168.11.18;} ;
                };

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

view "world" {
        match-clients { any; };
        allow-query { any; };
};
-----------------------------------------------------------------

[root@LVS sample]# dig @dns3.odn.ne.jp. gihyo.co.jp AXFR

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> @dns3.odn.ne.jp. gihyo.co.jp AXFR
; (1 server found)
;; global options: +cmd
; Transfer failed.
[root@LVS sample]#



[root@LVS sample]# dig @localhost testdomain1 axfr
;; Connection to ::1#53(::1) for testdomain1 failed: connection refused.

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> @localhost testdomain1 axfr
; (2 servers found)
;; global options: +cmd
testdomain1.            38400   IN      SOA     LVS.testdomain1. root.testdomain1. 1353762479 10800 3600 604800 38400
testdomain1.            38400   IN      NS      LVS.testdomain1.
testdomain1.            38400   IN      MX      10 mail.example.com.
HTTP.testdomain1.       38400   IN      A       192.168.11.19
HTTP2.testdomain1.      38400   IN      CNAME   HTTP.testdomain1.
LVS.testdomain1.        38400   IN      A       192.168.11.18
testdomain1.            38400   IN      SOA     LVS.testdomain1. root.testdomain1. 1353762479 10800 3600 604800 38400
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 17 19:22:33 2014
;; XFR size: 7 records (messages 1, bytes 213)

[root@LVS sample]#


[root@LVS sample]# dig @localhost testdomain1 any

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> @localhost testdomain1 any
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24048
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;testdomain1.                   IN      ANY

;; ANSWER SECTION:
testdomain1.            38400   IN      SOA     LVS.testdomain1. root.testdomain1. 1353762479 10800 3600 604800 38400
testdomain1.            38400   IN      NS      LVS.testdomain1.
testdomain1.            38400   IN      MX      10 mail.example.com.

;; ADDITIONAL SECTION:
LVS.testdomain1.        38400   IN      A       192.168.11.18

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 17 19:23:06 2014
;; MSG SIZE  rcvd: 136

[root@LVS sample]#






















bind 超簡易版

http://www.eis.co.jp/engineers-notes/bind9_src_build

/etc/named.conf

http://www4.ueda.ne.jp/~zhongcun/linux32.html

 

/var/named/chroot/etc/named.conf

-------------------------
options {
        directory       "/var/named";
        allow-query     { any; };
        allow-transfer     { any; };
        recursion yes;
        version "";
};


view "local" {
        allow-query { any; };
        zone "." IN {
                type hint;
                file "named.ca";
        };

        zone "testdomain1" {
                type master;
                file "testdomain1.local.hosts";
                };

        zone "11.168.192.in-addr.arpa" {
                type master;
                file "192.168.11.0.local.rev";
                };

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

view "world" {
        match-clients { any; };
        allow-query { any; };
};
-------------------------


/var/named/chroot/var/named/testdomain1.local.hosts
-------------------------
$ttl 38400
@               IN      SOA     LVS.testdomain1. root.testdomain1. (
                        1353762479
                        10800
                        3600
                        604800
                        38400 )

testdomain1.    IN      NS      LVS.testdomain1.
testdomain1.    IN      MX      10 mail.example.com.
LVS             IN      A       192.168.11.18
HTTP            IN      A       192.168.11.19
HTTP2           IN      CNAME   HTTP
-------------------------

 

/var/named/chroot/var/named/192.168.11.0.local.rev
-------------------------
$ttl 38400
@               IN      SOA     LVS.testdomain1. root.testdomain1. (
                        1353762926
                        10800
                        3600
                        604800
                        38400 )

               IN      NS      LVS.testdomain1.
18             IN      PTR     LVS.testdomain1.
19             IN      PTR     HTTP.testdomain1.
-------------------------

 

 

/etc/resolv.conf
-------------------------
search localdomain example.com
nameserver 192.168.84.132
-------------------------

/etc/sysconfig/network
-------------------------
NETWORKING=yes
HOSTNAME=LVS.testdomain1
-------------------------



[root@LVS sample]# dig @dns3.odn.ne.jp. gihyo.co.jp AXFR

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> @dns3.odn.ne.jp. gihyo.co.jp AXFR
; (1 server found)
;; global options: +cmd
; Transfer failed.
[root@LVS sample]#



[root@LVS sample]# dig @localhost testdomain1 axfr
;; Connection to ::1#53(::1) for testdomain1 failed: connection refused.

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> @localhost testdomain1 axfr
; (2 servers found)
;; global options: +cmd
testdomain1.            38400   IN      SOA     LVS.testdomain1. root.testdomain1. 1353762479 10800 3600 604800 38400
testdomain1.            38400   IN      NS      LVS.testdomain1.
testdomain1.            38400   IN      MX      10 mail.example.com.
HTTP.testdomain1.       38400   IN      A       192.168.11.19
HTTP2.testdomain1.      38400   IN      CNAME   HTTP.testdomain1.
LVS.testdomain1.        38400   IN      A       192.168.11.18
testdomain1.            38400   IN      SOA     LVS.testdomain1. root.testdomain1. 1353762479 10800 3600 604800 38400
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 17 19:22:33 2014
;; XFR size: 7 records (messages 1, bytes 213)

[root@LVS sample]#


[root@LVS sample]# dig @localhost testdomain1 any

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.23.rc1.el6_5.1 <<>> @localhost testdomain1 any
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 24048
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;testdomain1.                   IN      ANY

;; ANSWER SECTION:
testdomain1.            38400   IN      SOA     LVS.testdomain1. root.testdomain1. 1353762479 10800 3600 604800 38400
testdomain1.            38400   IN      NS      LVS.testdomain1.
testdomain1.            38400   IN      MX      10 mail.example.com.

;; ADDITIONAL SECTION:
LVS.testdomain1.        38400   IN      A       192.168.11.18

;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Fri Oct 17 19:23:06 2014
;; MSG SIZE  rcvd: 136

[root@LVS sample]#