重启后DNS会继续重置。 Ubuntu 17.10

所以我看到有很多问题。 我已经阅读了所有post,但似乎无法找到永久的解决方案。 我有Ubuntu 17.10,每次我的电脑重启,我都要重置dns服务器。

似乎对我有用的唯一解决方案是:

  1. 将谷歌的DNS服务器添加到我的/etc/resolv.conf文件中。
  2. validation它们是否列在我的网络管理员gui中
  3. 重新启动网络管理 (sudo systemctl重启NetworkManager)

我不知道为什么添加dns服务器到resolv.conf工作,只是为了覆盖它,但我不喜欢。 我的DNS不起作用。

我知道这不是正确的方法,但我尝试过的其他方法似乎都失败了。 我的另一个问题是,我在本地网络上有几台其他计算机(raspberry pi)我不能使用他们的名字进入他们。 我可以用他们的IP地址。

这是我目前的resolv.conf

# Generated by NetworkManager nameserver 127.0.1.1 

这是我的/ etc / hosts

 127.0.0.1 localhost 127.0.1.1 Bootes64 192.168.1.101 homeassistant 192.168.1.102 media 192.168.1.103 wdnas 192.168.1.120 security # 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 

这有永久的解决方案吗?

编辑这已被标记为类似问题的副本,但这是我与谷歌遇到的第一个问题之一。 没有任何建议有效。 看到最后的更新是在2014年,我有一些严重的疑虑,它将适用于17.10机器。

[为简单而重写 – 希望它有帮助]

你能运行systemd-resolve --status吗? 它是否返回有关网络适配器的DNS信息?

如果是,则运行sudo dpkg-reconfigure resolvconf

并确保/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 

然后重启网络管理器: sudo service network-manager restart

systemd解析器与其他解析器一起使用并选择合适的解析器。

我知道它不是正确的答案 – 但我最终只是重新安装了17.10。 Nuke和铺路。 现在我的DNS工作正常。