绑定从站缓慢更新区域

我在主/从configuration两个绑定服务器。 在主区域文件上增加串行时,在从站上更新所需的时间比预期的要长。 我已经在两台testing服务器上复制了这个问题。 5秒的ttl,奴隶更新需要几分钟的时间。 我使用Bind 9.8和Ubuntu 12.04。

这是我的主testing服务器的configuration:

named.conf.local

zone "example.com" { type master; file "/var/lib/bind/db.example.com.zone"; //forwarders {}; // If we do not comment the ''forwarders'' "empty" clients of the local subnet in my case don't have access to the upstream DNS ? //allow-update { key ns-example-com_rndc-key; }; allow-update { key rndc-key; }; //confusion between the file name to import (ns-example-com_rndc-key) and the key label (rndc-key) ? }; zone "0.168.192.in-addr.arpa" { type master; file "/var/lib/bind/db.example.com.inv.zone"; //see comment below (zone "example.com") //forwarders {}; //allow-update { key ns-example-com_rndc-key; }; allow-update { key rndc-key; }; }; 

db.root.example.com

 $TTL 5 @ IN SOA sid.example.com. root.example.com. ( 2007010416 ; Serial 5 ; Refresh [1m] 5 ; Retry [10m] 5 ; Expire [1d] 5 ) ; Negative Cache TTL [1h] ; @ IN NS sid.example.com. @ IN MX 10 sid.example.com. sid IN A 192.168.0.3 etch IN A 192.168.0.3 pop IN CNAME sid www IN CNAME sid mail IN CNAME sid 

db.example.com.inv.zone

 @ IN SOA sid.example.com. root.example.com. ( 2007010401 ; Serial 3600 ; Refresh [1h] 600 ; Retry [10m] 86400 ; Expire [1d] 600 ) ; Negative Cache TTL [1h] ; @ IN NS sid.example.com. 1 IN PTR sid.example.com. 2 IN PTR etch.example.com. 

这是从站的configuration:

 zone "example.com" { type slave; file "/var/cache/bind/db.example.com.zone"; masters { 192.168.0.2; }; //forwarders {}; // If we do not comment the ''forwarders'' "empty" clients of the local subnet in my case don't have access to the upstream DNS ? //allow-update { key ns-example-com_rndc-key; }; allow-update { key rndc-key; }; //confusion between the file name to import (ns-example-com_rndc-key) and the key label (rndc-key) ? }; zone "0.168.192.in-addr.arpa" { type slave; file "/var/cache/bind/db.example.com.inv.zone"; masters { 192.168.0.2; }; //see comment below (zone "example.com") //forwarders {}; //allow-update { key ns-example-com_rndc-key; }; allow-update { key rndc-key; }; }; 

从火箭科学家的复制左侧指南DNS :

默认情况下,BIND9会将NOTIFY消息发送给出现在区域的NS RR中的所有目标名称(右侧名称)

所以你需要在db.example.com.inv.zone添加你的从服务器作为一个NS条目。

另外,您可能需要添加设置:

  • 在主人: notify yes;allow-transfer { SLAVE_IP; }; allow-transfer { SLAVE_IP; };
  • 在奴隶: allow-notify { MASTER_IP; }; allow-notify { MASTER_IP; };

在主机上更改序列号时,会立即通知从机。 换句话说, notify是默认启用的。 但是,通知工作的方式是,主服务器查看区域文件中该特定域的NS records ,并通知NSlogging中列出的服务器(不包括其本身)。 在你的情况下,我没有看到从属服务器的主机名在db.root.example.com区域文件中被列为NSlogging。 因此,从机正在联系主机,列在从机的configuration文件 – masters { 192.168.0.2; }; masters { 192.168.0.2; }; 在刷新间隔,1小时。 这就是为什么更新需要很长时间。

解决scheme – 为从站添加NSlogging,也包括其IP地址作为Alogging。 典型的设置如下 –

  @ IN NS ns1.example.com. @ IN NS ns2.example.com. ns1 IN A 192.168.1.1 ns2 IN A 192.168.1.2 

第一和第三行,为主。 奴隶的第二和第四行。