* [gentoo-user] resolv.conf full of old info
@ 2022-10-18 22:21 Grant Edwards
2022-10-19 0:00 ` [gentoo-user] " Grant Edwards
0 siblings, 1 reply; 4+ messages in thread
From: Grant Edwards @ 2022-10-18 22:21 UTC (permalink / raw
To: gentoo-user
I've noticed that /etc/resolv.conf seems to accumulate obsolete,
useless info as my laptop moves from one network to another. It looks
like dhcpcd adds stuff when a connection comes up, but never removes
it when the connection goes down.
There are search entries and nameserver entries from networks I
haven't been connected to for a long time.
Even when there are no network interfaces up/configured,
/etc/resolv.conf is full of entries -- and none of them are useful or
valid.
I've tried shutting down all of the network interfaces, deleteting all
of the leases from /var/lib/dhcpcd and then removing resolv.conf. The
next time any interface comes up, /etc/resolv.conf is again full of
obsolete stuff along with the valid entries for the interface that has
just come up.
How do you get rid of old entries that show up in resolv.conf?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-user] Re: resolv.conf full of old info
2022-10-18 22:21 [gentoo-user] resolv.conf full of old info Grant Edwards
@ 2022-10-19 0:00 ` Grant Edwards
2022-10-19 9:22 ` Michael
0 siblings, 1 reply; 4+ messages in thread
From: Grant Edwards @ 2022-10-19 0:00 UTC (permalink / raw
To: gentoo-user
On 2022-10-18, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> I've noticed that /etc/resolv.conf seems to accumulate obsolete,
> useless info as my laptop moves from one network to another. It looks
> like dhcpcd adds stuff when a connection comes up, but never removes
> it when the connection goes down.
This appears to be caused by the "persistent" option in dhcpcd.conf,
which is set by default. I commented it out, and now resolv.conf
behaves rationally: it only contains info for network connections that
are up.
Why would dhcpcd have the persistent option enabled by default?
--
Grant
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-user] Re: resolv.conf full of old info
2022-10-19 0:00 ` [gentoo-user] " Grant Edwards
@ 2022-10-19 9:22 ` Michael
2022-10-19 13:39 ` Grant Edwards
0 siblings, 1 reply; 4+ messages in thread
From: Michael @ 2022-10-19 9:22 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
On Wednesday, 19 October 2022 01:00:31 BST Grant Edwards wrote:
> On 2022-10-18, Grant Edwards <grant.b.edwards@gmail.com> wrote:
> > I've noticed that /etc/resolv.conf seems to accumulate obsolete,
> > useless info as my laptop moves from one network to another. It looks
> > like dhcpcd adds stuff when a connection comes up, but never removes
> > it when the connection goes down.
>
> This appears to be caused by the "persistent" option in dhcpcd.conf,
> which is set by default. I commented it out, and now resolv.conf
> behaves rationally: it only contains info for network connections that
> are up.
>
> Why would dhcpcd have the persistent option enabled by default?
>
> --
> Grant
I think because this causes less breakage in those cases where netmount,
remote syslog-ng, SSH clients, or root mounted NFS is in play? This is what
the man page says about it:
"... dhcpcd normally de-configures the interface and configuration when it
exits. Sometimes, this isn't desirable if, for example, you have root mounted
over NFS or SSH clients connect to this host and they need to be notified of
the host shutting down."
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [gentoo-user] Re: resolv.conf full of old info
2022-10-19 9:22 ` Michael
@ 2022-10-19 13:39 ` Grant Edwards
0 siblings, 0 replies; 4+ messages in thread
From: Grant Edwards @ 2022-10-19 13:39 UTC (permalink / raw
To: gentoo-user
On 2022-10-19, Michael <confabulate@kintzios.com> wrote:
> On Wednesday, 19 October 2022 01:00:31 BST Grant Edwards wrote:
>> On 2022-10-18, Grant Edwards <grant.b.edwards@gmail.com> wrote:
>>
>> Why would dhcpcd have the persistent option enabled by default?
>
> I think because this causes less breakage in those cases where netmount,
> remote syslog-ng, SSH clients, or root mounted NFS is in play? This is what
> the man page says about it:
>
> "... dhcpcd normally de-configures the interface and configuration when it
> exits. Sometimes, this isn't desirable if, for example, you have root mounted
> over NFS or SSH clients connect to this host and they need to be notified of
> the host shutting down."
I guess that makes sense. What was confusing was that I read the man
page which said it was normally disabled, and since I had never
touched the config file, and wasn't passing the -p option I assumed it
was disabled -- then I finally looked through the default config file,
where it's "nomrally enabled".
--
Grant
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-19 13:39 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-18 22:21 [gentoo-user] resolv.conf full of old info Grant Edwards
2022-10-19 0:00 ` [gentoo-user] " Grant Edwards
2022-10-19 9:22 ` Michael
2022-10-19 13:39 ` Grant Edwards
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox