我已连接到互联网,但每当我 ping 一个网站时,我都会收到“名称解析暂时失败”的消息。
我已经尝试过以下操作:
- 修改 /etc/resolv.conf 以包含
nameserver 8.8.8.8
和nameserver 8.8.4.4
- 确保没有重定向 resolv.conf 的符号链接根据这个问题
- 跑步
sudo systemctl restart systemd-resolved.service
- 重启我的电脑
- 删除无线连接并重新连接
输出systemctl status systemd-resolved
:
systemd-resolved.service - Network Name Resolution
Loaded: loaded (/lib/systemd/system/systemd-resolved.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2023-02-13 09:35:20 EST; 19min ago
Docs: man:systemd-resolved.service(8)
man:org.freedesktop.resolve1(5)
https://www.freedesktop.org/wiki/Software/systemd/writing-network-configuration-managers
https://www.freedesktop.org/wiki/Software/systemd/writing-resolver-clients
Main PID: 799 (systemd-resolve)
Status: "Processing requests..."
Tasks: 1 (limit: 6677)
Memory: 8.3M
CPU: 169ms
CGroup: /system.slice/systemd-resolved.service
└─799 /lib/systemd/systemd-resolved
Feb 13 09:35:20 osprey-ThinkPad-T450 systemd[1]: Started Network Name Resolution.
Feb 13 09:35:31 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set search domain list to: adsroot.itcs.<REDACTED>.edu
Feb 13 09:35:31 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set default route setting: yes
Feb 13 09:35:31 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set DNS server list to: 10.10.10.10, 10.10.5.5
Feb 13 09:40:14 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client reset search domain list.
Feb 13 09:40:14 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set default route setting: no
Feb 13 09:40:14 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client reset DNS server list.
Feb 13 09:40:14 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set search domain list to: adsroot.itcs.<REDACTED>.edu
Feb 13 09:40:14 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set default route setting: yes
Feb 13 09:40:14 osprey-ThinkPad-T450 systemd-resolved[799]: wlp3s0: Bus client set DNS server list to: 35.0.0.12, 35.0.0.4`
我还可以尝试什么?
我正在运行 Ubuntu 22.04.1。
答案1
尝试将/etc/resolv.conf
文件设置为非存根版本。我在这方面取得了很大成功,尤其是当我的路由器提供 DHCP 时。
sudo rm /etc/resolv.conf
sudo ln -s /run/systemd/resolve/resolv.conf /etc/resolv.conf