Roger Heflin writes:
« HTML content follows »
once you update the file to be a good one, then do this:
chattr +i /etc/resolv.conf (that sets the immutable bit that disallows rename, write, delete).
That should prevent anything from overwriting the file. If you need to change the file you will have to -i the file first.
It is kind of crude but useful in cases where you really don't want a file to get changed.
I fear that it's only a matter of time before systemd-resolved's scriptlet gets changed to remove the immutable flag on the /etc/resolv.conf symlink before clobbering it.
It keeps finding its way back on my systems, even after I uninstalled it and told it to GTFO. More and more packages keep adding it as a dependency, and that's how it gets pulled back in.