Hacker News new | past | comments | ask | show | jobs | submit login

I'm pretty sure that just replacing the /etc/resolv.conf symlink with a regular file will prevent all of the major network configuration tools from modifying it. I've verified this for resolvconf and systemd-resolved at least:

> To make the resolver use this dynamically generated resolver configuration file the administrator should ensure that /etc/resolv.conf is a symbolic link to /run/resolvconf/resolv.conf. This link is normally created on installation of the resolvconf package. The link is never modified by the resolvconf program itself.[0]

> To improve compatibility, /etc/resolv.conf is read in order to discover configured system DNS servers, but only if it is not a symlink... [1]

[0]: http://manpages.ubuntu.com/manpages/zesty/man8/resolvconf.8....

[1]: https://www.freedesktop.org/software/systemd/man/systemd-res...




No, it won't. Some of the managers for this file will overwrite it.


NetworkManager is the one exception I'm aware of here, but I don't think any server distros use it. Using NM is also the best option for configuring desktop environments, so I wouldn't bother disabling its resolv.conf management functionality.


Doesn't RHEL ship with NM by default? And test on its usage?


It can be worth trying to set the file to immutable; chattr +i /etc/resolv.conf




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: