named.conf の zone 関連 hint のみ zone "." のみで どうなるかを 検討 する。
注意 dig の 項目は 抜粋 してあります
named.conf の 変更 zone ファイルの 削除(名前を 変更)
# cd /etc/
# cp named.conf named.conf_cash_test_01_ok
# vi named.conf
# cd /var/named/
# mv localhost.zone stop2_localhost.zone
# mv localhost.rev stop2_localhost.rev 
# 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";
};
include "/etc/rndc.key";
zone "." のみに なった どうなるか?
# shutdown -r now
基本的な項目の確認
$ su -
Password: 
# sed -n -e '/named/p' /var/log/messages 
Apr 11 11:50:48 lx named[66]: starting BIND 9.2.3
Apr 11 11:50:48 lx named[66]: using 1 CPU
Apr 11 11:50:49 lx named[66]: loading configuration from '/etc/named.conf'
Apr 11 11:50:49 lx named[66]: no IPv6 interfaces found
Apr 11 11:50:49 lx named[66]: listening on IPv4 interface lo, 127.0.0.1#53
Apr 11 11:50:49 lx named[66]: listening on IPv4 interface eth0, 192.168.0.5#53
Apr 11 11:50:49 lx named[66]: listening on IPv4 interface eth1, 192.168.2.1#53
Apr 11 11:50:49 lx named[66]: command channel listening on 127.0.0.1#953
Apr 11 11:50:50 lx named[66]: running
# rndc -s 192.168.0.5 status
rndc: connect failed: connection refused /* 当り前だの クラッカー  */
# cat /etc/rndc.conf
options {
        default-key "rndc-key";
        default-server 127.0.0.1;        /*  ここからだけよー! */
        default-port 953;
};
include "/etc/rndc.key";
# 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
zone の読み込みは無し ”number of zones: 2”なぜ 2個? 暗黙に hint と localhost があると いうこと? まあ今はわかんね dig 確認 するべ
$ 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: 181 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 12:03:47 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: Tue Apr 11 12:57:54 2006 ;; MSG SIZE rcvd: 183 $ 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: 5 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 12:58:22 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 12:58:56 2006 ;; MSG SIZE rcvd: 285
こんどは 自前から つまり 192.168.0.5 の 計算機から
$ dig @192.168.0.5 www.plala.or.jp ... ;; Query time: 66 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 13:01:44 2006 ;; MSG SIZE rcvd: 179 $ dig @192.168.0.5 www.plala.or.jp ... ;; Query time: 1 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 13:02:17 2006 ; MSG SIZE rcvd: 179 $ dig @192.168.0.5 -x 218.47.162.66 ... ;; Query time: 1 msec ;; SERVER: 192.168.0.5#53(192.168.0.5) ;; WHEN: Tue Apr 11 13:03:41 2006 ;; MSG SIZE rcvd: 285
ということは named.conf に ”hint”がありゃ良いのか
zone "." {
        type hint;
        file "root.hints";
};
当然 これも 削除してみる 必要があります。
にゃんたろう 拝!
2006年 4月11日 (火) 21:03:24 JST 作成