From owner-freebsd-questions Tue Oct 29 5:40:58 2002 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7942537B401 for ; Tue, 29 Oct 2002 05:40:57 -0800 (PST) Received: from gs166.sp.cs.cmu.edu (GS166.SP.CS.CMU.EDU [128.2.205.169]) by mx1.FreeBSD.org (Postfix) with SMTP id 0ADB543E6E for ; Tue, 29 Oct 2002 05:40:57 -0800 (PST) (envelope-from dpelleg@gs166.sp.cs.cmu.edu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15806.36823.388867.243667@gs166.sp.cs.cmu.edu> Date: Tue, 29 Oct 2002 08:40:39 -0500 To: Paulo Roberto , questions@freebsd.org Subject: Re: dhcp option to *not* overwrite /etc/resolv.conf X-Mailer: VM 6.90 under 21.1 (patch 14) "Cuyahoga Valley" XEmacs Lucid From: Dan Pelleg Reply-To: Dan Pelleg Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > Hi, > > I have read the man pages, searched a few forums, but I did not found a > way to prevent dhcp to do not change my /etc/resolv.conf. I do not have You can write a script to fix resolv.conf right after dhclient ruined it. The way to do it is to hook it from /etc/dhclient-exit-hooks (which you'll need to create). Here's mine, which calls two other scripts (not included), one of which only if the IP address actually changed. This one also gets the new servers as arguments. ------------------------------ /etc/dhclient-exit-hooks # nothing to do unless we're bound case ${reason} in BOUND | RENEW | REBIND | REBOOT ) [ -x /etc/set-ntp ] && . /etc/set-ntp if [ -n "${new_domain_name_servers}" ]; then if [ -z "${old_domain_name_servers}" ] || [ x${old_ip_address} != x{$new_ip_address} ]; then [ -x /etc/refresh-named ] && /etc/refresh-named ${new_domain_name_servers} fi fi ;; esac To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message