系统:Ubuntu18.04
错误:1 http://cn.archive.ubuntu.com/ubuntu focal InRelease 无法解析域名“cn.archive.ubuntu.com"
....
....
....
(1)临时解决方案
sudo vim /etc/resolv.conf
将127.0.0.53改成自己的ip(系统重启后又会变成默认值)
# This file is managed by man:systemd-resolved(8). Do not edit.
#
# 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 must 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

本文介绍了在Ubuntu 18.04系统中遇到DNS解析问题的解决方法。临时解决方案是修改/etc/resolv.conf文件,将nameserver改为本地IP。而一劳永逸的解决办法是编辑/etc/systemd/resolved.conf,添加114.114.114.114和8.8.8.8作为DNS,并重启systemd-resolved服务。
7928

被折叠的 条评论
为什么被折叠?



