Xubuntu 18.04: Temporary failure in name resolution

Linux howto's, compile information, information on whatever we learned on working with linux, MACOs and - of course - Products of the big evil....
Post Reply
User avatar
^rooker
Site Admin
Posts: 1483
Joined: Fri Aug 29, 2003 8:39 pm

Xubuntu 18.04: Temporary failure in name resolution

Post 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:
Jumping out of an airplane is not a basic instinct. Neither is breathing underwater. But put the two together and you're traveling through space!
Post Reply