在我的 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.com
或apt-get update
不起作用。
非常感谢您对此的任何帮助。