2 ms·
The fix for this nonsense is to put what you want into /etc/resolv.conf and chattr +i which sets the immutable bit on the file. I do this on the servers I mana
by rwmj 6y ago
The fix for this nonsense is to put what you want into /etc/resolv.conf and chattr +i which sets the immutable bit on the file. I do this on the servers I manage to stop NetworkManager/dhcpd/resolved/systemd/whatever is today's new thing from messing with the file. Although I suppose it's only a matter of time before something works this out and starts "helpfully" adjusting the immutable bit. At which point I'll patch the kernel.
- leephillips 6y agoHow do you ensure that today’s new thing will even look at the file?
- CameronNemo 6y agoRight resolved goes through glibc name resolution services if I recall. resolved.conf is just a fallback.
- rwmj 6y agoglibc controls what file(s) processes use. It goes through nsswitch.conf -> resolv.conf.
- viraptor 6y agoYou know you can disable the service, right? Rather than keep it running and fighting against your immutable bit.
- jmcnulty 6y agoThe only reason it's using systemd at all is because on Fedora /etc/resolv.conf is a soft link to /run/systemd/resolve/resolv.conf. As it states in the file ... # This file is managed by man:systemd-resolved(8). Do not edit. # # This is a dynamic resolv.conf file for connecting local clients directly to # all known uplink DNS servers. This file lists all configured search domains. # # Third party programs should typically not access this file directly, but only # through the symlink at /etc/resolv.conf. To manage man:resolv.conf(5) in a # different way, replace this symlink by a static file or a different symlink. # # See man:systemd-resolved.service(8) for details about the supported modes of # operation for /etc/resolv.conf. So if you don't want to use systemd for DNS then just replace the soft link with your own file. For static servers that makes sense; you're going to want to configure resolv.conf to use your own company/data center nameservers. But for not laptops where systemd is managing the DHCP service and the details (and nameservers) will change depending on your location.