我有一台 ubuntu 16.04 vm,它经常无法解析 DNS 请求。如您所见,我已设置 DNS 服务器:
➜ ~ nmcli device show ens33|grep IP4.DNS
IP4.DNS[1]: 4.2.2.2
IP4.DNS[2]: 8.8.8.8
IP4.DNS[3]: 208.67.222.222
但是 nslookup 无法解析该地址:
➜ ~ nslookup
> yahoo.com
;; connection timed out; no servers could be reached
奇怪的问题是我在 nslookup 上设置服务器并且它可以工作:
> server 4.2.2.2
Default server: 4.2.2.2
Address: 4.2.2.2#53
> yahoo.com
Server: 4.2.2.2
Address: 4.2.2.2#53
Non-authoritative answer:
Name: yahoo.com
Address: 206.190.36.45
Name: yahoo.com
Address: 98.138.253.109
Name: yahoo.com
Address: 98.139.183.24
我正在寻找某种方法来了解事物的工作原理并解决问题。
附言:我们公司使用一些 VPN 来连接互联网,以前在同样的情况下一切都正常。
*更新:*dig
虚拟机上的输出是:
➜ ~ dig
; <<>> DiG 9.10.3-P4-Ubuntu <<>>
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21749
;; flags: qr rd ra; QUERY: 1, ANSWER: 13, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;. IN NS
;; ANSWER SECTION:
. 518400 IN NS a.root-servers.net.
. 518400 IN NS b.root-servers.net.
. 518400 IN NS c.root-servers.net.
. 518400 IN NS d.root-servers.net.
. 518400 IN NS e.root-servers.net.
. 518400 IN NS f.root-servers.net.
. 518400 IN NS g.root-servers.net.
. 518400 IN NS h.root-servers.net.
. 518400 IN NS i.root-servers.net.
. 518400 IN NS j.root-servers.net.
. 518400 IN NS k.root-servers.net.
. 518400 IN NS l.root-servers.net.
. 518400 IN NS m.root-servers.net.
;; Query time: 234 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Sun May 14 15:44:47 IRDT 2017
;; MSG SIZE rcvd: 239