![DNS不工作:网管的DNS服务器坏了吗?](https://linux22.com/image/166615/DNS%E4%B8%8D%E5%B7%A5%E4%BD%9C%EF%BC%9A%E7%BD%91%E7%AE%A1%E7%9A%84DNS%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%9D%8F%E4%BA%86%E5%90%97%EF%BC%9F.png)
我的 DNS 服务器有些奇怪:我无法解析 url。
该/etc/resolv.conf
文件似乎由 NetworkManager 管理并指向127.0.0.53
(到目前为止看起来不错):
$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
# 127.0.0.53 is the systemd-resolved stub resolver.
# run "systemd-resolve --status" to see details about the actual nameservers.
nameserver 127.0.0.53
当我列出当前连接的 DNS 服务器时,nmcli device connection wlp3s0 | grep DNS
它会显示包含有效 DNS 服务器的 IP,即当我这样做时dig google.com @IPNMCLI
,我有一个有效的输出(到目前为止很好):
$ nmcli device show wlp2s0 | grep IP4.DNS
IP4.DNS[1]: 132.XX.XX.XX
IP4.DNS[2]: 132.YY.YY.YY
$ dig google.com @132.YY.YY.YY
; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> google.com @132.YY.YY.YY
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 37232
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 4, ADDITIONAL: 9
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;google.com. IN A
;; ANSWER SECTION:
google.com. 101 IN A 172.217.18.206
;; AUTHORITY SECTION:
google.com. 19122 IN NS ns2.google.com.
[...]
;; Query time: 3 msec
;; SERVER: 132.YY.YY.YY#53(132.YY.YY.YY)
;; WHEN: Tue Jan 28 14:49:39 CET 2020
;; MSG SIZE rcvd: 303
但是,当我尝试运行时dig google.com @127.0.0.53
,发送了一个请求,但答案有错误 SERVFAIL:
dig google.com @127.0.0.53
; <<>> DiG 9.11.3-1ubuntu1.11-Ubuntu <<>> google.com @127.0.0.53
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 59952
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 65494
;; QUESTION SECTION:
;google.com. IN A
;; Query time: 0 msec
;; SERVER: 127.0.0.53#53(127.0.0.53)
;; WHEN: Tue Jan 28 14:26:37 CET 2020
;; MSG SIZE rcvd: 39
知道出了什么问题吗?为什么 NetworkManager 的本地 DNS 服务器不工作?
谢谢。