就在 Ubuntu 升级到 20.04 之后,/etc/resolv.conf
包含:
nameserver 127.0.2.1
它不起作用。改为:
nameserver 127.0.0.53
但是每次重新启动后它都会被覆盖,我必须重新更改它。
我已经在这个盒子里安装了 Ubuntu 15.10,并定期升级它,这是解析器第一次出现这种行为不端。淘气!
如何永久解决此问题?
编辑:
输出$ ls -al /etc/resolv.conf
:
lrwxrwxrwx 1 root root 29 lis 1 2015 /etc/resolv.conf -> ../run/resolvconf/resolv.conf
内容/etc/resolv.conf
:
# 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 wroclaw.vectranet.pl
(它曾经是nameserver 127.0.2.1
在重新启动后,但不改变127.0.0.53
我将无法写这篇文章;)。)
内容/etc/hosts
:
127.0.0.1 localhost
127.0.1.1 marcin-Lenovo
# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
#188.165.239.159 wkaliszu.pl
#10.10.9.157 mskorzewski.axit.pl
X.X.X.X mskorzewski.axit.pl
(X.X.X.X
是一些真实的IP地址。)