![已连接 wifi 但无法访问互联网](https://linux22.com/image/955479/%E5%B7%B2%E8%BF%9E%E6%8E%A5%20wifi%20%E4%BD%86%E6%97%A0%E6%B3%95%E8%AE%BF%E9%97%AE%E4%BA%92%E8%81%94%E7%BD%91.png)
直到昨晚出现随机问题之前,我的 wifi 连接都没有问题。我已连接到家中的个人 wifi(所有其他设备都确认可以正常工作)。我正在运行 Ubuntu 22.04.4 LTS。我尝试过ping 8.8.8.8
并得到了响应。我也尝试过检查$ sudo systemctl status systemd-resolved
,确认它处于活动状态(正在运行)。我对 ubuntu 比较陌生,所以不确定接下来该怎么做。任何帮助都值得感激,很乐意提供任何新信息。
最后编辑:尽管其他评论者警告,我还是硬编码了 Google DNS 8.8.8.8,/etc/resolv.conf
然后运行sudo systemctl restart NetworkManager
,结果成功了。然后我重置了笔记本电脑,看看修复是否在重启后仍然有效,现在一切似乎都正常了。
第二次最终编辑:我现在已经重新连接到我的 VPN 并断开连接,一切似乎都正常。输出cat /etc/resolv.conf
如下:
# This is /run/systemd/resolve/stub.resolv.conf managed by man:systemd-resolved(8).
# Do not edit.
#
# This file might be symlinked as /etc/resolv.conf. If you're looking at
# /etc/resolv.conf and seeing this text, you have followed the symlink.
#
# This is a dynamic resolv.conf file for connecting local clients to the
# internal DNS stub resolver of systemd-resolved. This file lists all
# configured search domains.
#
# Run "resolvectl status" to see details about the uplink DNS servers
# currently in use.
#
# Third party programs should typically not access this file directly, but only
# through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a
# different way, replace this symlink by a static file or a different symlink.
#
# See man:systemd-resolved.service(8) for details about the supported modes of
# operation for /etc/resolv.conf
nameserver 127.0.0.53
options edns0 trust-ad
search cable.virginm.net4
编辑 1:我将所有 DNS 保留为默认设置。$ ping -c google.com
没有回应。
编辑 2:我的路由器的 DNS 是 194.168.4.100 和 194.168.8.100。当我检查$ resolvectl status
Link 3 (wlo1) 的输出时,结果如下:
Current Scopes: DNS
Protocols: +DefaultRoute +LLMNR -mDNS -DNSOverTLS DNSSEC=no/unsupported
Current DNS Server: 194.168.4.100
DNS Servers: 194.168.4.100 194.168.8.100
DNS Domain: cable.virginm.net
编辑 3:我偶尔会使用 VPN 来工作,但已经尝试过这篇文章中的解决方案:Ubuntu 18.04 中断开 VPN 后无互联网连接 但没有人解决我的问题。