You are not logged in.

#1 2022-03-01 13:04:59

-thc
Member
Registered: 2017-03-15
Posts: 1,086

Strange behavior of systemd when "resolv.conf" is missing

On a virtual (lab) Arch box I tried to switch from systemd-networkd/systemd-resolved to NetworkManager.

After disabling both via systemctl, removing both the networkd related conf file and /etc/resolv.conf, installing NetworkManager and rebooting I realized resolv.conf was existing, but not there. It was a dead link to the non-existent stub file of systemd-resolved. NetworkManager does not (possibly can not) correct or change this.

Even after disabling NetworkManager's DNS completely, "resolv.conf" will be created as a dead link as long as it's non-existent before booting.

The solution is to create an empty file instead of deleting it.

Is this by design?

Offline

#2 2022-03-01 13:58:17

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Strange behavior of systemd when "resolv.conf" is missing

That seems to be by design, yes. systemd provides a rule to create the link if the file is missing, but Arch's filesystem package provides an empty (except for comments) resolv.conf. So you have to opt-in to using resolved and to revert that, you should recreate/reinstall the file (or mask the tmpfiles.d snippet).

Last edited by Raynman (2022-03-01 14:00:32)

Offline

#3 2022-03-01 14:29:55

-thc
Member
Registered: 2017-03-15
Posts: 1,086

Re: Strange behavior of systemd when "resolv.conf" is missing

O.K. - Thanks.

Offline

Board footer

Powered by FluxBB