注意 dig の 項目は 抜粋 してあります
named.conf として 次の 様に してみたい
# /usr/local/sbin/named-checkconf # cat /etc/named.conf acl nyansblx { 192.168.0.0/24; 127.0.0.1; }; options { directory "/var/named"; pid-file "/var/run/named/named.pid"; recursion yes; allow-recursion { nyansblx ; }; allow-query { nyansblx ; }; allow-transfer { none; }; forward first ; forwarders { 192.168.0.1; }; }; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; }; }; zone "." { type hint; file "root.hints"; }; zone "localhost" { type master; file "localhost.zone"; }; zone "0.0.127.in-addr.arpa" { type master; file "localhost.rev"; }; zone "bcnet.ne.jp" { type master; file "bcnet.hosts"; }; zone "0.168.192.in-addr.arpa" { type master; file "bcnet.hosts.rev"; }; include "/etc/rndc.key"; # shutdown -r now
再起動後
$ su - Password: # sed -n -e '/running/p' messages Apr 10 23:15:16 lx named[66]: running $ ssh -l mm 192.168.0.8 Password: mm@nyanta:~$ dig @lx.bcnet.ne.jp cricrima-sa.no-ip.info ;; ANSWER SECTION: cricrima-sa.no-ip.info. 60 IN A 219.167.38.78 ;; Query time: 188 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Mon Apr 10 23:21:05 2006 ;; MSG SIZE rcvd: 167 ..... $ dig @lx.bcnet.ne.jp cricrima-sa.no-ip.info ;; Query time: 3 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Mon Apr 10 23:22:01 2006 ;; MSG SIZE rcvd: 167 # rndc status number of zones: 6 debug level: 0 xfers running: 0 xfers deferred: 0 soa queries in progress: 0 query logging is OFF server is up and running
これは ほとんど 元のままである。
# pwd /etc # cp named.conf named.conf_almost_org # vi named.conf # cat named.conf # cat named.conf acl nyansblx { 192.168.0.0/24; 127.0.0.1; }; options { directory "/var/named"; pid-file "/var/run/named/named.pid"; recursion yes; allow-recursion { nyansblx ; }; allow-query { nyansblx ; }; allow-transfer { none; }; forward first ; forwarders { 192.168.0.1; }; }; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1; } keys { "rndc-key"; }; }; zone "." { type hint; file "root.hints"; }; zone "localhost" { type master; file "localhost.zone"; }; zone "0.0.127.in-addr.arpa" { type master; file "localhost.rev"; }; include "/etc/rndc.key"; # cd /var/named/ # mv bcnet.hosts stop_bcnet.hosts # mv bcnet.hosts.rev stop_bcnet.hosts.rev
log clear
# :>/var/log/messages # :>/var/log/syslog $ exit logout Connection to 192.168.0.8 closed. # :>/var/log/syslog # shutdown -r now
これで どうなるか 確認
$ su - Password: # sed -n -e '/running/p' /var/log/messages Apr 10 23:34:18 lx named[66]: running $ ssh -l mm 192.168.0.8 Password: $ dig @192.168.0.5 cricrima-sa.no-ip.info MX ;; ANSWER SECTION: cricrima-sa.no-ip.info. 60 IN MX 10 cricrima-sa.no-ip.info. ;; Query time: 198 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Mon Apr 10 23:42:22 2006 ;; MSG SIZE rcvd: 183 ... $ dig @192.168.0.5 cricrima-sa.no-ip.info MX ;; Query time: 3 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Mon Apr 10 23:43:01 2006 ;; MSG SIZE rcvd: 167 # rndc status number of zones: 4 debug level: 0 xfers running: 0 xfers deferred: 0 soa queries in progress: 0 query logging is OFF server is up and running
良いのでしょう だが 当然今まで ”http://www.bcnet.ne.jp”で アクセス出来ていたが ”http://192.168.0.5/” で 無いと アクセス 出来なく なった 当り前だが また ”syslog”に こういう ものが 有るが これも 当然であろう これに 関する zone file が 存在 しな いのであるから。
# cat /var/log/syslog Apr 10 23:34:17 lx rpc.mountd: nl.bcnet.ne.jp has non-inet addr Apr 10 23:34:17 lx rpc.mountd: nl.bcnet.ne.jp has non-inet addr Apr 10 23:34:18 lx exportfs[75]: nl.bcnet.ne.jp has non-inet addr Apr 10 23:34:18 lx exportfs[75]: nl.bcnet.ne.jp has non-inet addr
参考迄に
# sed -n -e '/named/p' /var/log/messages Apr 11 22:32:16 lx named[66]: starting BIND 9.2.3 Apr 11 22:32:16 lx named[66]: using 1 CPU Apr 11 22:32:17 lx named[66]: loading configuration from '/etc/named.conf' Apr 11 22:32:17 lx named[66]: no IPv6 interfaces found Apr 11 22:32:18 lx named[66]: listening on IPv4 interface lo, 127.0.0.1#53 Apr 11 22:32:18 lx named[66]: listening on IPv4 interface eth0, 192.168.0.5#53 Apr 11 22:32:18 lx named[66]: listening on IPv4 interface eth1, 192.168.2.1#53 Apr 11 22:32:18 lx named[66]: command channel listening on 127.0.0.1#953 Apr 11 22:32:19 lx named[66]: zone 0.0.127.in-addr.arpa/IN: loaded serial 20030121 Apr 11 22:32:19 lx named[66]: zone localhost/IN: loaded serial 20030121 Apr 11 22:32:19 lx named[66]: running # rndc -s 127.0.0.1 status number of zones: 4 debug level: 0 xfers running: 0 xfers deferred: 0 soa queries in progress: 0 query logging is OFF server is up and running
zone file の 読み込みが ”zone 0.0.127.in-addr.arpa/IN: loaded serial 20030121” と ”zone localhost/IN: loaded serial 20030121” に なり 今まで ”number of zones: 6” であったのが ”number of zones: 4” に なっている。なんで 4個 なのか? 3個なら 未だわかるが??
http://www.bind9.net/manual/bind/9.3.0/Bv9ARM.html
status
Display status of the server. Note the number of zones includes the internal bind/CH zone and the default ./IN hint zone if there is not a explicit root zone configured.
これで 3個 になる 理由が 和猫 故 読み取れない それはさておき、参考迄に 他の 計算機 から 逆引き 可能かの確認
mm@lx:~$ ssh -l mm 192.168.0.8 Password: $ dig @192.168.0.5 www.plala.or.jp ... ;; ANSWER SECTION: www.plala.or.jp. 558 IN A 218.47.162.66 www.plala.or.jp. 558 IN A 218.47.162.65 ... $ dig @192.168.0.5 -x 218.47.162.66 ;; ANSWER SECTION: 66.162.47.218.in-addr.arpa. 86400 IN PTR wwwf.plala.or.jp. ;; Query time: 63 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 11:34:44 2006 ;; MSG SIZE rcvd: 190 $ dig @192.168.0.5 -x 218.47.162.66 ;; Query time: 2 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 11:35:27 2006 ;; MSG SIZE rcvd: 190 $ exit logout Connection to 192.168.0.8 closed.
あと どこまで 削れるか 追求 しておこう まず local 2個 削除 してみよ う
にゃんたろう 拝!
2006年 4月11日 (火) 23:09:55 JST 作成