Nsswitch.conf hosts: something adding "[!UNAVAIL=return]"

For some mysterious reason, on one of my hosts, the /etc/nsswitch.conf file (actually /etc/static/nsswitch.conf) contains the following hosts line:

hosts:     mymachines resolve [!UNAVAIL=return] files myhostname dns

On my other hosts it contains what I actually want it to contain:

hosts:     mymachines files myhostname dns

I can’t for the life of me figure out what is causing it to add [!UNAVAIL=return] and I’d like that to be removed because now it’s not resolving hostnames without domain names on my LAN.

I hope someone can shed some light on the issue.

Any takers, please? I can’t figure this one out :confused:

I have the opposite problem: I need that resolve added (for printing reasons) but I cannot edit the file!

I’m still trying to figure it out, but I have the feeling that our problems have a similar solution …

1 Like

Yes, I still have this issue. Well, you could always move the /etc/nsswitch.conf symlink aside and put a file in its place manually.

I suspect that what’s causing it is systemd.network. This one host is my only host using that, that is also getting this configuration entry in nsswitch.conf. So you could try to configure your networking with systemd.network.

Resolved module seems to add that to the nss config