25

I've just upgraded my laptop from Xubuntu 17.04 to 17.10. After the final reboot, DNS has stopped working. This is obviously a problem! I can ping known IP addresses; just no DNS resolution.

I've not fiddled with any DNS settings; as far as I know, I had the standard DNS configuration previously. Its just a laptop which uses DHCP to get details from my home WiFi router.

Obviously, the ability to diagnose this is limited when the system itself can't resolve any web addresses. I did some googling on my phone, and most of the answers I found seemed to recommend turning dnsmasq off. However, dnsmasq was already off. But /etc/resolv.conf was showing 127.0.1.1, which seems to imply that it was expecting dnsmasq to be running.

I turned dnsmasq ON, by editing /etc/NetworkManager/NetworkManager.conf and adding

[main]
dns=dnsmasq

and then I ran this command

sudo systemctl restart NetworkManager

My DNS resolution is now working.

However, given that the default Ubuntu configuration is not to use dnsmasq, what should I actually have done to diagnose and fix this instead?

3 Answers3

35

I was updating Ubuntu today form version 16.10 through 17.04 to 17.10. For me too DNS stopped working. The resolv.conf symlink was

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

This is apparently wrong for 17.10. The error message the previous poster got is from the output of resolvconf -service:

$ systemctl status resolvconf

It gave the following output.

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

By removing the original symlink, linking to /run/resolvconf/resolv.conf to /etc/resolv.conf and restarting the resolvconf -service DNS began working again:

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

Interestingly the exit code of the resolvconf-service was success even before the symlink was pointing towards the correct file.

Rooney
  • 975
7

I found this bug reported here: https://bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1725840; please confirm that you also suffering from it. It is resolved through a simple dpkg-reconfigure resolvconf.

della
  • 346
1

I ran into the same issue and saw this looking at 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

Recreating the symlink fixed it. Now using 127.0.0.53 by default now?

$ 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
Drew H
  • 11