The problem
So systemd-resolved has bugs. Disabling and stopping systemd-resolved to escape these is the logical step, but a dhcp-managed system does gracefully not fall back to resolvconf-managed file even though dhclient still executes the hook for it. As a result, you're then left with a broken resolv.conf that never gets updated by dhclient.
The reason is the systemd-resolved hook in dhclient only checks to see whether it is executable, and not whether it is also enabled. As a result, it still overwrites the default make_resolv_conf
shell function with systemd-resolved logic. Since the resolvconf
hook is executed before the resolved
hook, you either have to rename it to a name that sorts after resolved
, or symlink it thusly; but this doesn't fix the bug.
This diff fixes the resolved
hook to actually check for the enabled state of the service in addition to checking whether it is executable. Not the best sequence of steps -- better to check the binary's executable state first, then check whether systemd indicates it's enabled, then override resolver update logic if so. However this does get the job done on a systemd-based system.