bind9でNSレコードを他のDNSに権限委譲したときに、正しい値を返さない系の話

  • こんな感じでサブドメイン(others.sample.japan)を他のDNS(subdns1.sample.japan)に権限委譲するとする。
$ORIGIN .
$TTL 600        ; 10 minutes
sample.japan     IN SOA  ns1.sample.japan. root.sample.japan. (
                                2008080101 ; serial
                                7200       ; refresh (2 hours)
                                7200       ; retry (2 hours)
                                2419200    ; expire (4 weeks)
                                600        ; minimum (10 minutes)
                                )
                        NS      ns1.sample.japan.
                        NS      ns2.sample.japan.
                        A       192.168.1.10
                        MX      10 mail.sample.japan.
$ORIGIN sample.japan.
others                  NS      subns1.sample.china.
                        NS      subns2.sample.china.
ftp                     A       192.168.1.10
mail                    A       192.168.1.11
ns1                     A       192.168.1.1
ns2                     A       192.168.1.2
www                     A       192.168.1.10

これで others.sample.japan 正引きは subns1.sample.china と subns2.sample.china に委譲される。

  • おもむろに委譲側でnslookupとかしてみる。digでもいいけど。
$ nslookup
> server 192.168.1.1
Default server: ns1.sample.japan
Address: 192.168.1.1#53
> others.sample.japan
Server:         ns1.sample.japan
Address:        192.168.1.1#53

Non-authoritative answer:
Name:   others.sample.japan
Address: xxx.xxx.xxx.xxx (委譲されたNSで設定された値)

と返るのが期待値。
しかし、まったく返さない場合がある。

このときチェックするポイントは、

  1. 委譲された側(sample.china側)が正しくゾーンレコードを持っているか
  2. 委譲された側(sample.china側)がそもそもちゃんとゾーン自体を持っているか
  3. named.conf で resursion yes; って書いてあるか

って感じ。

言いたかったのは3つ目に注意ってことであります。