epoch1970
Posts: 3804
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

systemd-resolved - This is going to be good

Mon Apr 15, 2019 3:11 pm

I'm late to the party it seems but these days I am fiddling with ubuntu 18-02 machines and today suddenly my resolver stopped working on some. I use the old interfaces config file on these machines, the uplink is a simplistic dhcp client.

I had the delight to read, line 3 and 4...

Code: Select all

$ 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.
...
... that ubuntu had switched to using a systemd service to configure the resolver and it runs a local DNS forwarder by default.

I don't mind the DNS forwarder, although when I want one I configure dnsmasq myself. The worry was that somehow dhclient and resolved are not completely in tune so the DHCP-defined DNS servers were missing from /etc/resolv.conf on some machines (not all)...

EDIT: Caveat emptor. If you do what follows, you're butchering your system. Do not blindly remove system files on your OS. The VMs I was doing this on were disposable.

To revert to a working /etc/resolv.conf I had to run:

Code: Select all

sudo systemctl disable systemd-resolved.service
sudo systemctl stop systemd-resolved
sudo rm /etc/dhcp/dhclient-enter-hooks.d/resolved
sudo reboot
Look ma, no "chattr -i". Ok, an rm instead...

The man page for systemd-resolved doesn't have the "I don't like this, how do I disable this?" section you can find in their PNIN page. I suppose it will come in good time.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Off topic discussion”