我使用了很长时间的一个 WiFi 网络遇到了 DNS 问题。我尝试用手机建立热点,一切正常,因此问题仅出现在该网络上。
ping 8.8.8.8
有效,但是
nslookup google.com
;; Got SERVFAIL reply from 127.0.0.53, trying next server
;; connection timed out; no servers could be reached
我尝试过安装resolvconf
和网上找到的其他解决方案,但没有一个起作用。
/etc/resolv.conf
这是(添加后nameserver 8.8.8.8
)的内容/etc/resolvconf/resolv.conf.d/tail
:
# 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
search station
nameserver 8.8.8.8
答案1
我找到的解决方案是
- 确保域名解析已安装 (
sudo apt-get install dnsmasq
) - 添加
dns=dnsmasq
到以下[main]
部分/etc/NetworkManager/NetworkManager.conf