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.
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
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."
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 302 |
Nodes: | 16 (2 / 14) |
Uptime: | 97:57:47 |
Calls: | 6,766 |
Calls today: | 4 |
Files: | 12,295 |
Messages: | 5,376,385 |
Posted today: | 1 |