• [gentoo-user] resolv.conf full of old info

    From Grant Edwards@21:1/5 to All on Wed Oct 19 00:30:02 2022
    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?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Edwards@21:1/5 to Grant Edwards on Wed Oct 19 02:10:01 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Michael@21:1/5 to All on Wed Oct 19 10:22:05 2022
    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."
    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCAAdFiEEXqhvaVh2ERicA8Ceseqq9sKVZxkFAmNPwb0ACgkQseqq9sKV ZxnR6g/+MMXTDU0gyU4BJW6Ow7b6SNw10tUVhH4YAMaA5cF4mguO1AQviRbvvos5 VZfJFz/53kMRPs6NWQTnWlqRxh3fJgk95oU30neAWH37Px3EnrBB0aBruJ/XphWn 7wP1Pjl0+q9Pxfx1eTFt/H+v4ofzTVeCnjPPOJnqTVQ8AVSwxxqmPwIY2nBC8cj7 nLuAwhHvYpPRkP2ggthtmrXHxpl5fZv4GV2UfpafWN87179hd213Hz4Sqzw3cXIp LqKCoN7sb3joIbQ/+DZ9SUaieXKygpMmNNLMVHS4rvf5zUCpMK7TkPJ0xV8HBFqq YARjpGT8zw3KBGZRS3EdxrzWN4WpZSp2nCHgD5v8LGYnminmwX9S8Jiuz5+G5EpV fgsaBfVs/5UviilSMq2rHhMlbqMbUxblHios5GrbuR1W3k7P+YeLQ8vsEy+clfxy 7LrxaGFOC6PxiWXZPRUQeNPm08CiA3Q6A1sbCmi9hGX6fCCSUhVi7VHdG82s02/z 3W/uyh1/t4uF8WTVEXfZsIyYy6bXjJYH6v1n0OxsPi+dy8ap+BNPAjOGkvWLC+Qf 9cWogEqnWn0BVcWDK2cfDxJs+KrBXMd7fmWM3VO2R5QjEHzOiDTain/R5wSYR00W H7Zw6u6gV87tVhXQcMFauca6O/HUcQCAE1xbO9xeWxQ51EEr51Y=
    =lRsY
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Grant Edwards@21:1/5 to Michael on Wed Oct 19 15:40:01 2022
    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)