Ubuntu 22.04 LTS重启后需手动启动systemd-resolved才能正常上网的问题求助
Ubuntu 22.04 LTS重启后需手动启动systemd-resolved才能正常上网的问题求助
昨天一切都还正常,但今天(重启后)我突然无法访问互联网了。奇怪的是,我能ping通8.8.8.8,但无法解析google.com,显然是DNS解析出了问题。
当我执行以下命令后,网络就恢复正常了:
sudo systemctl enable systemd-resolved
我查看了systemd-resolved的状态,输出如下:
systemd-resolved.service - Network Name Resolution Loaded: loaded (/lib/systemd/system/systemd-resolved.service; disabled; vendor preset: enabled) Active: active (running) since Tue 2023-07-18 21:07:34 CEST; 40min 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: 12966 (systemd-resolve) Status: "Processing requests..." Tasks: 1 (limit: 9213) Memory: 4.9M CPU: 1.073s CGroup: /system.slice/systemd-resolved.service └─12966 /lib/systemd/systemd-resolved jul 18 21:07:34 chewbacca systemd-resolved[12966]: Positive Trust Anchors: jul 18 21:07:34 chewbacca systemd-resolved[12966]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d jul 18 21:07:34 chewbacca systemd-resolved[12966]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.a> jul 18 21:07:34 chewbacca systemd-resolved[12966]: Using system hostname 'chewbacca'. jul 18 21:07:34 chewbacca systemd-resolved[12966]: wlp2s0: Bus client set default route setting: yes jul 18 21:07:34 chewbacca systemd[1]: Started Network Name Resolution. jul 18 21:07:34 chewbacca systemd-resolved[12966]: wlp2s0: Bus client set DNS server list to: 46.227.67.134, 192.165.9.158 jul 18 21:07:48 chewbacca systemd-resolved[12966]: Using degraded feature set UDP instead of UDP+EDNS0 for DNS server 46.227.67.134. jul 18 21:13:02 chewbacca systemd-resolved[12966]: Using degraded feature set UDP instead of UDP+EDNS0 for DNS server 46.227.67.134. jul 18 21:15:39 chewbacca systemd-resolved[12966]: Grace period over, resuming full feature set (UDP+EDNS0) for DNS server 46.227.67.134.
另外,我已经在/etc/systemd/resolved.conf里配置了DNS服务器,文件内容如下:
# This file is part of systemd. # # systemd is free software; you can redistribute it and/or modify it under the # terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 2.1 of the License, or (at your option) # any later version. # # Entries in this file show the compile time defaults. Local configuration # should be created by either modifying this file, or by creating "drop-ins" in # the resolved.conf.d/ subdirectory. The latter is generally recommended. # Defaults can be restored by simply deleting this file and all drop-ins. # # Use 'systemd-analyze cat-config systemd/resolved.conf' to display the full config. # # See resolved.conf(5) for details. [Resolve] # Some examples of DNS servers which may be used for DNS= and FallbackDNS=: # Cloudflare: 1.1.1.1#cloudflare-dns.com 1.0.0.1#cloudflare-dns.com 2606:4700:4700::1111#cloudflare-dns.com 2606:4700:4700::1001#cloudflare-dns.com # Google: 8.8.8.8#dns.google 8.8.4.4#dns.google 2001:4860:4860::8888#dns.google 2001:4860:4860::8844#dns.google # Quad9: 9.9.9.9#dns.quad9.net 149.112.112.112#dns.quad9.net 2620:fe::fe#dns.quad9.net 2620:fe::9#dns.quad9.net DNS=46.227.67.134 FallbackDNS=192.165.9.158 #Domains= #DNSSEC=no #DNSOverTLS=no #MulticastDNS=no #LLMNR=no #Cache=no-negative #CacheFromLocalhost=no #DNSStubListener=yes #DNSStubListenerExtra= #ReadEtcHosts=yes #ResolveUnicastSingleLabel=no
我已经做了这些操作:
- 在路由器里设置了相同的两个DNS服务器
- 通过GUI在网络连接的IPv4设置选项卡中添加了这两个DNS服务器
但现在还是每次重启后都需要手动启动systemd-resolved才能正常上网,我已经谷歌搜索了好几个小时都没找到原因,实在有点摸不着头绪,希望各位能给我一些指点!
谢谢!
备注:内容来源于stack exchange,提问作者Evert Homan
相关产品推荐
相关产品推荐

