From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 89946158020 for ; Tue, 18 Oct 2022 22:21:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D75E5E0893; Tue, 18 Oct 2022 22:21:49 +0000 (UTC) Received: from ciao.gmane.io (ciao.gmane.io [116.202.254.214]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 90E52E0876 for ; Tue, 18 Oct 2022 22:21:49 +0000 (UTC) Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1okuy2-000Aci-UV for gentoo-user@lists.gentoo.org; Wed, 19 Oct 2022 00:21:46 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Grant Edwards Subject: [gentoo-user] resolv.conf full of old info Date: Tue, 18 Oct 2022 22:21:42 -0000 (UTC) Message-ID: User-Agent: slrn/1.0.3 (Linux) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: de92a0e2-7d4e-435b-887e-729386a2764c X-Archives-Hash: 61e54561d2c613701e36bd1fbbd3c272 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?