1

在我的 Ubuntu 17.04 机器ping google.com上没有工作。所以我打开了/etc/resolv.conf文件,它的内容是:

nameserver 192.168.1.1
nameserver 127.0.0.53

我添加nameserver 8.8.8.8到上面的文件中,但它在重新启动网络服务时被覆盖。

因此,正如其他答案中提到的,我添加nameserver 8.8.8.8/etc/resolvconf/resolv.conf.d/base文件中并重新启动了网络服务。现在名称服务器值出现在/etc/resolv.conf文件中,但ping google.comapt-get update不起作用。

非常感谢您对此的任何帮助。

4

1 回答 1

2

我通过引用解决了上述问题:https ://askubuntu.com/a/973025

系统解析--状态

退回了这个

Global
     DNS Servers: 192.168.1.23

我想改变这一点。所以在阅读了上面的答案后,我编辑了/etc/systemd/resolved.conf

[Resolve]
DNS=192.168.1.1

并重新启动服务 -

服务 systemd-resolved 重启

现在systemd-resolve --status返回了这个

Global
     DNS Servers: 192.168.1.1
于 2020-03-04T04:50:09.637 回答