运行 bind 9.8.2 并在查询位于我的某个视图中的主机时收到 servfail 错误。以下是我的 conf 文件的片段。
view "insideview" {
match-clients { 192.168.100.202; };
zone "internal" IN {
type master;
file "/var/named/db.internal.com";
notify yes;
allow-update { none; };
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
};
view "external" {
match-clients { any; };
extzone1
extzone2
extzone3
extzone4
etc, etc...
};
仅当我的匹配列表 (192.168.100.102) 中的客户端尝试查询 internal.com db 文件中的内部区域中的主机时,才会发生失败。这是我的 db 文件。
$TTL 86400
@ IN SOA dns.testlab.net. root.testlab.net. (
2015012877
28800 ; refresh 8 hours
7200 ; retry 2 hours
864000 ; expire 10 days
86400 ; min ttl 1 day
)
IN NS dns.testlab.net.
server1 IN A 192.168.155.206
因此,当我从 192.168.100.202 查询 server1.testlab.net 时,我得到了 servfail。我打开了调试,以下是日志的输出。
12-Aug-2016 10:57:59.764 query-errors: debug 1: client 192.168.100.202#41591: view insideview: query failed (SERVFAIL) for server1.testlab.net/IN/A at query.c:6569
12-Aug-2016 10:57:59.764 query-errors: debug 2: fetch completed at resolver.c:3076 for server1.testlab.net/A in 0.000047: failure/success [domain:testlab.net,referral:0,restart:1,qrysent:0,timeout:0,lame:0,nete rr:0,badresp:0,adberr:2,findfail:0,valfail:0]
服务重新加载后,/var/log/messages 的样子如下:
received control channel command 'reload'
loading configuration from '/etc/named.conf'
reading built-in trusted keys from file '/etc/named.iscdlv.key'
using default UDP/IPv4 port range: [1024, 65535]
using default UDP/IPv6 port range: [1024, 65535]
no IPv6 interfaces found
sizing zone task pool based on 18 zones
Warning: view insideview: 'empty-zones-enable/disable-empty-zone' not set: disabling RFC 1918 empty zones
Warning: view extview: 'empty-zones-enable/disable-empty-zone' not set: disabling RFC 1918 empty zones
reloading configuration succeeded
reloading zones succeeded
zone internal/IN/insideview: loaded serial 2015012877
zone testlab.net/IN/extview: zone serial (2015091713) unchanged. zone may fail to transfer to slaves.
zone testlab.net/IN/extview: loaded serial 2015091713
received control channel command 'stats'
dumpstats complete
如果我从“任意”列表中的另一个主机 IP 查询 DNS 服务器,我可以返回结果,但仅限于“外部”视图中列出的区域,因此它按预期工作。有人能帮我弄清楚为什么我的内部视图不起作用吗?
答案1
改变了这个:
view "insideview" {
match-clients { 192.168.100.202; };
zone "internal" IN {
更改为:
view "insideview" {
match-clients { 192.168.100.102; };
zone"testlab.net" IN {
现在可以按预期工作。