DNS与bind9的不稳定性

我已经在我的本地networking的Ubuntu 14.04 / trusty(内核4.4.0-59)上为bind9(9.9.5)设置了一个DNS。 它正在工作,但有时它找不到主机的IP(例如ping说: ping: unknown host aypi1.bxlab )。

我的设置如下。

/etc/bind/named.conf.options:

 options { directory "/var/cache/bind"; dnssec-validation auto; auth-nxdomain no; listen-on-v6 { none; }; allow-query { 127.0.0.1; 192.168.0.0/24; }; }; 

/etc/bind/named.conf.local:

 zone "bxlab" IN { type master; file "/etc/bind/db.intra"; }; zone "0.168.192.in-addr.arpa" IN { type master; file "/etc/bind/db.0.168.192"; }; 

/etc/bind/db.intra:

 $TTL 1D ; @ IN SOA bxlab. root.bxlab ( 2011102401 ; Serial 3H ; Refresh 1H ; Retry 1W ; Expire 1D ) ; Minimum IN NS aypi1.bxlab. ; aypi0 IN A 192.168.0.10 ; aypi1 IN A 192.168.0.11 ; aypi2 IN A 192.168.0.12 ; ns IN CNAME aypi1 ; 

/etc/bind/db.0.168.192:

 $TTL 1D ; @ IN SOA ns.bxlab. root.ns.bxlab ( 2011102301 ; Serial 3H ; Refresh 1H ; Retry 1W ; Expire 1D ) ; Minimum IN NS ns.bxlab. IN PTR bxlab. IN A 255.255.255.0 10 IN PTR aypi0 ; 11 IN PTR aypi1 ; 12 IN PTR aypi2 ; 

我也改变了我的路由器configuration如下:

 Primary DNS: 192.168.0.11 Secondary: xxx.xxx.xxx.xxx (DNS IP Provided by ISP) 

麻烦是:

  1. 重新启动bind9后,nslookup与aypi1.bxlab一起工作。
  2. 30分钟后(?), ping aypi1.bxlab返回ping: unknown host aypi1.bxlab
  3. 但是等了几秒钟(也许是6秒?),ping就开始工作了。
  4. 2和3重复。

有没有人有想法解决这个问题?

非常感谢!

正如@pete在上面的评论中指出的,问题是路由器的configuration。

我修改了路由器的DNS设置:

 Primary DNS: 192.168.0.11 Secondary: 0.0.0.0 

然后我修改/etc/bind/named.conf.options为:

 options { [...] forwarders {xx.xx.xx.xx; xx.xx.xx.yy; xx.xx.xx.zz;}; forward first; }; 

转发器中的IP是来自ISP的DNS。