Page 1 of 1

Xubuntu 18.04: Temporary failure in name resolution

PostPosted: Fri Feb 22, 2019 1:58 am
by ^rooker
[PROBLEM]
It's annoying :?
I have a proper DNS/DHCP set up at home (on Raspbian :D) and would have proper name resolution, but due to the recent introduction of dnsmasq or systemd-resolvd, I'm having name resolving issues all the time.

Since 18.04, I always have "127.0.0.53" as DNS IP in /etc/resolv.conf.
And my LAN services stop working every other day.

When I try to ping the machine that seems to be unavailable, I get:
"Temporary failure in name resolution"

:evil:

And I'm not the only one...

[SOLUTION]
You have to disable "systemd-resolvd":

1) Disable and stop the "systemd-resolvd" service:
Code: Select all
$ systemctl disable systemd-resolved
$ systemctl stop systemd-resolved


2) Move the /etc/resolv.conf symbolic link:
Move the symlink to "/run/systemd/resolve/stub-resolv.conf" aside, to "resolv.conf.org" (as backup):
Code: Select all
$ mv /etc/resolv.conf /etc/resolv.conf.org

Now it looks like this:
lrwxrwxrwx 1 root root 39 Jän 29 17:00 /etc/resolv.conf.org -> ../run/systemd/resolve/stub-resolv.conf


3) Then, tell NetworkManager to take care of DNS/resolv.conf again:
Edit /etc/NetworkManager/NetworkManager.conf (but make a backup before ;)) - and add the following 2 options under [main]
dns=default
rc-manager=resolvconf

So it looks like this afterwards:
Code: Select all
[main]
plugins=ifupdown,keyfile
dns=default
rc-manager=resolvconf


4) Restart NetworkManager:
Code: Select all
$ systemctl restart NetworkManager



If all went well, and you are not connected to a network, your /etc/resolv.conf should now look iike this:
# Generated by NetworkManager

And if you connect to a network, it should contain the DNS IPs and search masks as proposed by the DHCP server :D

btw: This also greatly speeds up the name resolution for everything now!

Actually, I'd rather like to leave it on, because the developers had a reason to put it there, but it just breaks name resolution completely most of the time...

Links:
  • https://blog.mesouug.com/2018/09/22/how-to-correctly-disable-systemd-resolved-on-ubuntu-18-04/
  • https://www.hiroom2.com/2017/08/24/ubuntu-1610-nameserver-127-0-0-53-en/
  • https://www.admintome.com/blog/turning-off-systemd-resolvd/