我最近升级了我的DNS服务器上的BIND,现在DNS不能用于我的任何网站。 执行nslookup导致超时,并且在不同的服务器上使用dig告诉我查询中没有返回权威的部分。 然而,在服务器上使用本地dig ,会产生预期的结果。
我尝试了在DNSsy.com上find的工具,告诉我没有我的名称服务器的Alogging,这似乎是基于我的区域文件不正确。 以下是我configuration的区域文件之一(实际的域名和IP地址被replace/屏蔽):
$ORIGIN example.com. $TTL 1W @ IN SOA ns.example.com. example.example.com. ( 2011060701 ; Serial 28800 ; Refresh 14400 ; Retry 604800 ; Expire - 1 week 10800 ) ; Minimum IN NS ns IN MX 10 mail localhost IN A 127.0.0.1 @ IN A xxxx ns IN A xxxx mail IN A xxxx www IN CNAME @
acl "xfer" { none; }; acl "trusted" { 127.0.0.0/8; ::1/128; }; options { directory "/var/bind"; pid-file "/var/run/named/named.pid"; listen-on-v6 { ::1; }; listen-on { 127.0.0.1; }; allow-query { trusted; }; allow-query-cache { trusted; }; allow-recursion { trusted; }; allow-transfer { none; }; allow-update { none; }; forward first; forwarders { 8.8.8.8; // Google Open DNS 8.8.4.4; // Google Open DNS }; }; logging { channel default_log { file "/var/log/named/named.log" versions 5 size 50M; print-time yes; print-severity yes; print-category yes; }; category default { default_log; }; category general { default_log; }; }; include "/etc/bind/rndc.key"; controls { inet 127.0.0.1 port 953 allow { 127.0.0.1/32; ::1/128; } keys { "rndc-key"; }; }; zone "." in { type hint; file "/var/bind/root.cache"; }; zone "localhost" IN { type master; file "pri/localhost.zone"; notify no; }; zone "127.in-addr.arpa" IN { type master; file "pri/127.zone"; notify no; }; zone "xxxin-addr.arpa" IN { type master; file "pri/xxxzone"; notify no; }; zone "example.com" IN { type master; file "pri/example.com.zone"; notify no; };
没有,我认为这意味着没问题。
named-checkzone example.com /var/bind/pri/example.com.zone zone example.com/IN:loaded serial 2011060701 OK
allow-query指令仅限于仅包含localhost的trusted acl。 这就是为什么你只能从本地主机得到响应。 您需要将其更改为任何。
另外请注意, listen-on-v6节中需要有除localhost之外的IP地址 – 否则外部客户端将永远无法连接到您的域名服务器。