bind9不响应DNS请求

我试图设置一个基本的DNS服务器,只是转发来自其他DNS服务器的请求。

我已经安装了bind9并编辑了/etc/bind/named.conf.options文件如下。

 options { directory "/var/cache/bind"; // If there is a firewall between you and nameservers you want // to talk to, you may need to fix the firewall to allow multiple // ports to talk. See http://www.kb.cert.org/vuls/id/800113 // If your ISP provided one or more IP addresses for stable // nameservers, you probably want to use them as forwarders. // Uncomment the following block, and insert the addresses replacing // the all-0's placeholder. forwarders { 8.8.8.8; }; //======================================================================== // If BIND logs error messages about the root key being expired, // you will need to update your keys. See https://www.isc.org/bind-keys //======================================================================== dnssec-validation auto; auth-nxdomain no; # conform to RFC1035 listen-on-v6 { any; }; }; 

所以它应该转发请求到谷歌DNS服务器(微不足道,但我打算在以后添加更多)。

接下来我编辑了/etc/network/interfaces来添加DNS服务器作为回环(127.0.0.1)进行testing,然后我执行了一个sudo service bind9 start和一个sudo ifdown ens33 && sudo ifup ens33将它全部向上。

但这似乎并没有奏效。 我执行了一个dig google.com ,并没有解决它自己的请求(127.0.0.1)。

 ; <<>> DiG 9.10.3-P4-Ubuntu <<>> google.com ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 63300 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; OPT PSEUDOSECTION: ; EDNS: version: 0, flags:; udp: 4000 ;; QUESTION SECTION: ;google.com. IN A ;; ANSWER SECTION: google.com. 276 IN A 216.58.220.110 ;; Query time: 0 msec ;; SERVER: 192.168.0.3#53(192.168.0.3) ;; WHEN: Sun Feb 26 16:43:05 PST 2017 ;; MSG SIZE rcvd: 55 

我也尝试通过Windows 7机器连接到外部DNS服务器,但似乎没有解决任何问题,Windows 7机器的nslookup查询提供了以下结果。

 nslookup google.com Server: UnKnown Address: 192.168.0.188 DNS request timed out. timeout was 2 seconds. DNS request timed out. timeout was 2 seconds. DNS request timed out. timeout was 2 seconds. *** Request to UnKnown timed-out 

我已经执行了sudo service bind9 status ,告诉我服务是活跃的,但似乎有一些解决问题。

 ◠bind9.service - BIND Domain Name Server Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: enabled) Drop-In: /run/systemd/generator/bind9.service.d └─50-insserv.conf-$named.conf Active: active (running) since Sun 2017-02-26 16:26:44 PST; 20min ago Docs: man:named(8) Process: 1329 ExecStop=/usr/sbin/rndc stop (code=exited, status=0/SUCCESS) Main PID: 1334 (named) Tasks: 7 (limit: 512) CGroup: /system.slice/bind9.service └─1334 /usr/sbin/named -f -u bind Feb 26 16:39:24 ubuntu named[1334]: network unreachable resolving '151.in-addr.arpa/DNSKEY/IN': 2001:500:2f::f#53 Feb 26 16:39:24 ubuntu named[1334]: REFUSED unexpected RCODE resolving '151.in-addr.arpa/DNSKEY/IN': 202.12.27.33#53 Feb 26 16:39:24 ubuntu named[1334]: network unreachable resolving '151.in-addr.arpa/DNSKEY/IN': 2001:dc3::35#53 Feb 26 16:39:24 ubuntu named[1334]: REFUSED unexpected RCODE resolving '151.in-addr.arpa/DNSKEY/IN': 192.112.36.4#53 Feb 26 16:39:24 ubuntu named[1334]: REFUSED unexpected RCODE resolving '151.in-addr.arpa/DNSKEY/IN': 192.228.79.201#53 Feb 26 16:39:24 ubuntu named[1334]: network unreachable resolving '151.in-addr.arpa/DNSKEY/IN': 2001:500:84::b#53 Feb 26 16:39:24 ubuntu named[1334]: network unreachable resolving '151.in-addr.arpa/DNSKEY/IN': 2001:500:12::d0d#53 Feb 26 16:39:24 ubuntu named[1334]: REFUSED unexpected RCODE resolving '151.in-addr.arpa/DNSKEY/IN': 198.97.190.53#53 Feb 26 16:39:24 ubuntu named[1334]: network unreachable resolving '151.in-addr.arpa/DNSKEY/IN': 2001:500:1::53#53 Feb 26 16:39:24 ubuntu named[1334]: broken trust chain resolving '69.65.101.151.in-addr.arpa/PTR/IN': 8.8.8.8#53 

任何人都可以发现我做错了什么,或者给我指出我应该接下来要检查什么?