升级 17.04至 17.10后,网络管理器DNS无法工作

分享于 

3分钟阅读

ubuntu

  繁體

问题

通过编辑/etc/NetworkManager/NetworkManager.conf,我打开了dnsmasq


[main]


dns=dnsmasq



然后我做了


sudo systemctl restart NetworkManager



DNS解析现在有效。


答案1

resolv.conf符号链接是


/etc/resolv.conf -> /run/NetworkManager/resolv.conf



上一个poster得到的错误消息来自resolvconf -service的输出:


$ systemctl status resolvconf



它给出了以下输出。


resolvconf[623]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf



通过删除原始的符号链接,将/run/resolvconf/resolv.conf链接到/etc/resolv.conf,并重新启动resolvconf -service DNS,再次开始工作:


$ sudo rm /etc/resolv.conf


$ sudo ln -s /run/resolvconf/resolv.conf /etc/resolv.conf


$ systemctl restart resolvconf



有趣的是,即使符号链接指向正确的文件之前,resolvconf-service的退出代码仍然成功。


答案2

我发现这个bug报告在这里:https://bugs.launchpad.net/ubuntu/source/resolvconf/bug/1725840;它可以通过简单的dpkg-reconfigure resolvconf来解决。


答案3

我遇到了同样的问题,看到了resolvconf


Oct 20 00:36:17 drew-8570w resolvconf[708]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /run/resolvconf/resolv.conf



重新创建符号链接修复它,现在默认使用127.0.0.53?


$ ls -al /etc/resolv.conf 


lrwxrwxrwx 1 root drew 27 Apr 6 2017 /etc/resolv.conf -> /run/resolvconf/resolv.conf


$ cat /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





MAN  network  DNS  
相关文章