[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Why does resolv.conf keep changing?



On Fri 27 Oct 2017 at 08:35:05 (-0400), Greg Wooledge wrote:
> On Fri, Oct 27, 2017 at 01:18:58PM +0100, Darac Marjal wrote:
> > Who's saying it must be installed?
> 
> A few people in this thread, though I think they're saying "should"
> rather than "must".
> 
> > Maybe I've missed something, but I think
> > the consensus in this discussion was that if you want your resolv.conf to be
> > unmanaged/static/administrator-controlled, then don't have resolvconf
> > installed. If you have resolvconf installed, then what's the point of
> > neutering it with a command?

Conceivably, one could switch between a *docked laptop with
chattr +i of a real file* that is occasionally taken on the road
with the simple actions of chattr -i and ln -s being necessary
to effect the change.
All the daemons could be working away as normal all the time,
but just rendered impotent when docked.

AFAICT this will also keep systemd happy when docked, and undocking
can be done with a symlink to /run/systemd/resolve/resolv.conf
(rather than /etc/resolvconf/run/resolv.conf), allowing
systemd-resolved.service to perform again.

> Let's review what we've learned so far.
> 
> If you want to make local modifications to /etc/resolv.conf and have
> them stick, here are some ways to do it:
> 
> 1) chattr +i /etc/resolv.conf

With the common sense assumptions that a real file has had the
required data entered, that would seem to be sufficient, without
having to cope with the complications following.

> 2) Individually configure each daemon that might try to modify the file,
>    to make it stop doing so.
> 
> 3) Install the resolvconf package, because by doing so you also install
>    various hacks that modify the behavior of all known Debian daemons,
>    stopping them from writing to /etc/resolv.conf.
> 
>    Then tell resolvconf itself to do nothing by putting resolvconf=NO
>    in the /etc/resolvconf.conf file.

Cheers,
David.


Reply to: