6 ms·
After running into this a while ago when I was rebuilding my system and getting annoyed by all the different things that try to modify it, I ended up giving up
by petronio 8y ago
After running into this a while ago when I was rebuilding my system and getting annoyed by all the different things that try to modify it, I ended up giving up and just setting the file to immutable. It has been working fine for the past couple of months as nothing seems to autodetect the flag and try to remove it.
chattr +i /etc/resolv.conf
- smhenderson 8y agoI started doing this exact same thing in Debian, I think around Wheezy. Lately I’m back onSlackware and a little *BSD. Thankfully these systems still go the traditional route so it’s not much of an issue anymore.
- lkirk 8y agoI have used this in the past. There are only a few places where this bites you, for instance wifi authentication portals. Some of these wifi access points change your resolv.conf so that you can load their internal page for terms and conditions.
- low_key 8y agoIn addition, if you're using dhcp, you can add an enter hook to override make_resolv_conf so /etc doesn't get cluttered with a ton of extra files.
- gjs278 8y agosame thing I do because vpnc insists on overwriting it
- narag 8y agoIs there a tool that can log processes trying to modify a file?
- williamscales 8y agoI've been doing this for months as well. Works beautifully, I thought I was the only one.
- DavideNL 8y agoSame. I'm just a Linux "amateur", but what a huge mess to configure something so trivial/simple... (in Debian/Ubuntu compared to Mac/Windows.)
- zcid 8y agoThis is usually the easiest way especially if you use a caching resolver like unbound and you expect resolv.conf to always point to localhost.