DNS 转发区域不会解析新记录

DNS 转发区域不会解析新记录

我有一台主 DNS 服务器(BIND9,IP 172.23.129.24),配置为将转发区域指向另一台配置了 DDNS 服务的主服务器。此指令位于 /etc/named.conf 文件中。

zone "forward.example.com" {
    type forward;
    forwarders {172.23.129.130;};
};

在 172.23.129.130 服务器上,我的配置具有以下区域(以及其他部分中的 omapi-key 设置):

zone "forward.example.com" {
    type master;
    file "/var/named/forward.example.com.hosts";
    allow-update {
            key omapi-key;
            172.23.129.21;
            172.23.129.22;
            };
    };

“forward.example.com”区域文件如下所示:

$ORIGIN .
$TTL 38400  ; 10 hours 40 minutes
forward.example.com        IN SOA  ns.example.com. myemail.example.com. (
                            1486523615 ; serial
                            10800      ; refresh (3 hours)
                            3600       ; retry (1 hour)
                            604800     ; expire (1 week)
                            38400      ; minimum (10 hours 40 minutes)
                            )
                    NS  ns.example.com.
$ORIGIN ns.example.com.
$TTL 3600   ; 1 hour
first-host A     172.17.7.5
              TXT   "ID_STRING"
...etc.

当我手动添加一个条目时(首先冻结区域,然后由于它是动态的,所以解冻),它会出现,我可以通过使用 dig 定位具有转发区域的服务器来解决它:

dig @172.23.129.130 manual-entry.forward.example.com

这将成功,我得到了答案。但是,如果我对转发的主服务器执行相同操作,则会失败:

dig @172.23.129.24 manual-entry.forward.example.com

; <<>> DiG 9.8.3-P1 <<>> manual-entry.forward.example.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 65339
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 0

;; QUESTION SECTION:
;manual-entry.forward.example.com.  IN  A

;; AUTHORITY SECTION:
manual-entry.forward.example.com.   3474    IN  SOA ns.example.com.    myemail.example.com. 1486523594 10800 3600 604800 38400

;; Query time: 47 msec
;; SERVER: 172.23.129.24#53(172.23.129.24)
;; WHEN: Fri Dec 15 22:37:49 2017
;; MSG SIZE  rcvd: 107

同时,使用“dig”定位“forward.example.com”区域中的其他条目也很好用。我已经应用了该区域,重新启动了 BIND,并进行了许多其他工作来重新加载该区域。该文件显示了条目,并且使用 dig 命令定位的服务器应该只是将所有对“forward.example.com”域的请求转发到第二台服务器。在某些情况下它会这样做,但在其他情况下不会,这让我有些困惑。有什么建议可以参考吗?

答案1

您可能希望将其配置为slave区域而不是转发区域。这将要求主服务器允许从从属服务器传输此区域。您还可以配置主区域以在区域更改时通知从属区域。

一个域有两个缓存值。对于正匹配,可以为每个域设置缓存时间,但通常默认为 $TTL 行中指定的值。对于负匹配,bind 使用 max-ncache-ttl 的最小值(默认为 3 小时)和 SOA 记录中的最小值。

如果在主加载之前没有搜索域,则转发域应该转发请求,找到它并缓存它。

相关内容