如何debuggingBINDconfiguration?

有没有什么办法来了解我的Bind9服务器正在做什么一步一步的?

目前,我正在努力解决请求被拒绝的问题,并dig告诉recursion requested but not available 。 但是recursion不应该涉及到,因为这应该是授权服务器。

我该怎么做才能明白哪里出错?

下面是dig @127.0.0.1 client.example.com的响应:

 ; <<>> DiG 9.10.3-P4-Ubuntu <<>> @127.0.0.1 client.example.com ; (1 server found) ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 55821 ;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1 ;; WARNING: recursion requested but not available ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4096 ;; QUESTION SECTION: ;client.example.com. IN A ;; Query time: 0 msec ;; SERVER: 127.0.0.1#53(127.0.0.1) ;; WHEN: Tue Oct 31 01:09:08 EET 2017 ;; MSG SIZE rcvd: 54 

我尝试使用详细模式(这是从另一台机器发出的请求)debugging,这是我得到的:

 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921: UDP request 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921: request is not signed 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921: recursion not available 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921: query 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): query (cache) 'client.example.com/A/IN' denied 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): query failed (REFUSED) for client.example.com/IN/A at ../../../bin/named/query.c:6475 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): error 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): send 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): sendto 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): senddone 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): next 31-Oct-2017 00:48:04.363 client 198.51.100.2#54921 (client.example.com): endrequest 31-Oct-2017 00:48:04.363 client @0x123456789abcdef: udprecv 

不幸的是,我不明白在这种情况下如何得到recursion。

如果任何人都可以帮我手动debugging,这是我的服务器是如何设置的。

named.conf中:

 include "/etc/bind/named.conf.options"; include "/etc/bind/named.conf.local"; include "/etc/bind/named.conf.default-zones"; 

named.conf.options:

 options { directory "/var/cache/bind"; dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; listen-on port 53 { any; }; recursion no; allow-transfer { localhost; }; allow-query-cache { none; }; allow-query { any; }; }; 

named.conf.local:

 zone "example.com" { type master; file "/etc/bind/zones/example.com"; }; 

区/ example.com:

 $TTL 300 @ IN SOA ns.example.com. admin.example.com ( 4 ; Serial 300 ; Refresh 300 ; Retry 2419200 ; Expire 300 ) ; Negative Cache TTL @ IN NS ns.example.com. ns IN A 192.0.2.1 @ IN A 192.0.2.1 www IN A 192.0.2.1 client IN A 192.0.2.1 @ IN MX 50 mx.example.net. @ IN MX 100 mx2.example.net. 

名为named.conf.default-zones的文件保留为默认安装的文件以及默认区域的文件。

我正在使用BIND 9.10.3-P4-Ubuntu。

-d 1启动BIND将启用debugging。 根据您的OS /发行版,您可能需要查找如何设置启动命令行参数。 如果您需要更多信息,您可以增加价值。

如果你想要更多的指导,你应该在你的问题中发布你的configuration文件,重新编写秘密并用例子replace你的名字。 其他人在查看您的设置时可能会在此处标识这些内容。

更新1:

我认为这个错误可能是因为named不能读取区域文件,所以它完全忽略了这个区域,让它认为它应该问别处,但是不能,因为recursion被禁用。 查看日志文件返回到何时启动,看看是否有任何暗示正在发生。