前へ|次へ|戻る

bind 3004 test cash only

named.conf の zone 関連 統べてなしで どうなるかを 検討する。

注意 dig の 項目は 抜粋 してあります

named.conf

named.conf の 変更

# cd /etc/
# cp named.conf named.conf_only_hint_02_ok
# vi 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"; };
 };
include "/etc/rndc.key";
$ exit
logout
Connection to 192.168.0.8 closed.
# :>/var/log/syslog 
# :>/var/log/messages 
# shutdown -r now

test no zone

再起動 基本的なもの確認

$ su -
Password: 
# sed -n -e '/named/p' /var/log/messages 
Apr 11 13:27:01 lx named[66]: starting BIND 9.2.3
Apr 11 13:27:01 lx named[66]: using 1 CPU
Apr 11 13:27:02 lx named[66]: loading configuration from '/etc/named.conf'
Apr 11 13:27:02 lx named[66]: no IPv6 interfaces found
Apr 11 13:27:02 lx named[66]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 11 13:27:02 lx named[66]: listening on IPv4 interface eth0, 192.168.0.5#53
Apr 11 13:27:02 lx named[66]: listening on IPv4 interface eth1, 192.168.2.1#53
Apr 11 13:27:02 lx named[66]: command channel listening on 127.0.0.1#953
Apr 11 13:27:02 lx named[66]: running
# rndc -s 127.0.0.1 status
number of zones: 2
debug level: 0
xfers running: 0
xfers deferred: 0
soa queries in progress: 0
query logging is OFF
server is up and running

ななんと ”number of zones: 2”ですよ ななんで!! といわずに 試験です

$ ssh -l mm 192.168.0.8
Password: 
$ dig @192.168.0.5 www.plala.or.jp
;; ANSWER SECTION:
www.plala.or.jp.        600     IN      A       218.47.162.65
www.plala.or.jp.        600     IN      A       218.47.162.66
;; Query time: 68 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Apr 11 13:35:09 2006
;; MSG SIZE  rcvd: 179
$ dig @192.168.0.5 www.plala.or.jp
;; Query time: 3 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Apr 11 13:36:05 2006
;; MSG SIZE  rcvd: 179


$ 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: 9 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Apr 11 13:35:29 2006
;; MSG SIZE  rcvd: 285
$ dig @192.168.0.5 -x 218.47.162.66
;; Query time: 4 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Apr 11 13:36:20 2006
;; MSG SIZE  rcvd: 285

192.168.0.5 の 計算機で

$ dig @192.168.0.5 cricrima-sa.no-ip.info
;; ANSWER SECTION:
cricrima-sa.no-ip.info. 60      IN      A       219.167.38.78
;; Query time: 244 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Apr 11 13:37:16 2006
;; MSG SIZE  rcvd: 167
$ dig @192.168.0.5 cricrima-sa.no-ip.info
;; Query time: 1 msec
;; SERVER: 192.168.0.5#53(192.168.0.5)
;; WHEN: Tue Apr 11 13:38:02 2006
;; MSG SIZE  rcvd: 167

なんも いらんのです 当然 bind (named)も 入らんのです dig と /etc/resolv.conf の 設定が できていたら 問い合わせは 出来るはずです

# ps ax | grep named | grep -v grep
   66 ?        S      0:00 /usr/sbin/named
# kill 66
# ps ax | grep named | grep -v grep
# tail -6 /var/log/messages 
Apr 11 13:47:30 lx named[66]: shutting down
Apr 11 13:47:30 lx named[66]: stopping command channel on 127.0.0.1#953
Apr 11 13:47:30 lx named[66]: no longer listening on 127.0.0.1#53
Apr 11 13:47:30 lx named[66]: no longer listening on 192.168.0.5#53
Apr 11 13:47:30 lx named[66]: no longer listening on 192.168.2.1#53
Apr 11 13:47:30 lx named[66]: exiting

192.168.0.8 の 計算機で

$ dig @192.168.0.5 -x 218.47.162.66

; <<>> DiG 9.3.1 <<>> @192.168.0.5 -x 218.47.162.66
; (1 server found)
;; global options:  printcmd
;; connection timed out; no servers could be reached

当然だべ そしたら 192.168.0.5 の計算機で

$ dig @192.168.0.5 cricrima-sa.no-ip.info

; <<>> DiG 9.2.3 <<>> @192.168.0.5 cricrima-sa.no-ip.info
;; global options:  printcmd
;; connection timed out; no servers could be reached

これも 当然だべ 所が resolv.conf が こうなっているので 其ままでは ”127.0.0.1”に 問い合わせる事になる

# cat /etc/resolv.conf
search bcnet.ne.jp
nameserver 127.0.0.1  

そこで adsl router に 問い合わせを かけると (adsl-router IP 192.168.0.1)

$ dig @192.168.0.1 cricrima-sa.no-ip.info
;; ANSWER SECTION:
cricrima-sa.no-ip.info. 60      IN      A       219.167.38.78
;; Query time: 287 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Apr 11 13:57:43 2006
;; MSG SIZE  rcvd: 189
$ dig @192.168.0.1 cricrima-sa.no-ip.info

;; Query time: 2 msec
;; SERVER: 192.168.0.1#53(192.168.0.1)
;; WHEN: Tue Apr 11 13:58:14 2006
;; MSG SIZE  rcvd: 78

いけるんよ だから resolv.conf を 適切に 設定しておきさえすれば 問い合わせは 可能ということなんだ わ(この場合 adsl-router の IP address を 設定)

問い合わせを 繰り返した場合に 時間が 短く なってるということは adsl-router か どこかで cash が きいてるのだろう

にゃんたろう 拝!
2006年 4月11日 (火) 23:03:24 JST 作成


前へ|次へ|戻る

Copyright © 2004.-2007. nyantarou All Rights Reserved.