From owner-freebsd-questions Thu Dec 14 13: 3:19 2000 From owner-freebsd-questions@FreeBSD.ORG Thu Dec 14 13:03:15 2000 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mailhost01.reflexnet.net (mailhost01.reflexnet.net [64.6.192.82]) by hub.freebsd.org (Postfix) with ESMTP id C583E37B400 for ; Thu, 14 Dec 2000 13:03:15 -0800 (PST) Received: from rfx-64-6-211-1.users.reflexcom.com ([64.6.211.149]) by mailhost01.reflexnet.net with Microsoft SMTPSVC(5.5.1877.197.19); Thu, 14 Dec 2000 13:01:37 -0800 Received: (from cjc@localhost) by rfx-64-6-211-1.users.reflexcom.com (8.11.0/8.11.0) id eBEL3Cd38964 for questions@freebsd.org; Thu, 14 Dec 2000 13:03:12 -0800 (PST) (envelope-from cjc) Date: Thu, 14 Dec 2000 13:03:12 -0800 From: "Crist J. Clark" To: questions@freebsd.org Subject: dhclient Goofing /etc/resolv.conf Message-ID: <20001214130312.B38903@rfx-64-6-211-1.users.reflexcom.> Reply-To: cjclark@alum.mit.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i Sender: cjc@rfx-64-6-211-1.users.reflexcom.com Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG This is really strange. My dhclient has started to mess up building /etc/resolv.conf. What happens is that the output generated in the /etc/dhclient-exit-hooks script is somehow finding its way into the resolv.conf. How it is doing this has me stumped. The section of /sbin/dhclient-script of interest is, echo search $new_domain_name >/etc/resolv.conf for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>/etc/resolv.conf done exit_with_hooks 0 All 'exit_with_hooks' does is load the /etc/dhclient-exit-hooks script. There are numbers in my firewall that need to be refreshed if my address changes so all it does is reload my firewall rules, #!/bin/sh # # dhclient-exit-hooks - 2000/07/29 # # Refresh firewall since IP address of external interface may # have changed. # Load in site configuration. Stolen from /etc/rc. if [ -f /etc/defaults/rc.conf ]; then . /etc/defaults/rc.conf source_rc_confs elif [ -f /etc/rc.conf ]; then . /etc/rc.conf fi # This is right out of /etc/rc.network (1.39.2.14). Disabling the # verbosity, lines left in but commented out. if [ -z "${firewall_script}" ] ; then firewall_script="/etc/rc.firewall" fi if [ -f "${firewall_script}" -a X"$firewall_enable" = X"YES" ]; then . "${firewall_script}" # echo -n 'Firewall rules loaded, starting divert daemons:' fi #End Now, once an hour when dhclient decides to renew our lease on the IP, it recreates the /etc/resolv.conf. It looks like, search reflexnet.net Flushed all rules. 00100 allow ip from any to any via lo0 00200 deny log logamount 10000 ip from any to 127.0.0.0/8 00000 deny log logamount 10000 ip from 64.6.211.149 to not 64.6.211.255 recv fxp0 . . . So we get the fist line that we want, but after that... I am at somewhat of a loss as to how this is happening. I have any number of ideas of how to stop it, but I'd rather figure out _why_ this is happening and fix it right. This seems like it is a bug because I can't see where I have done anything wrong. Hope someone out there has some ideas. -- Crist J. Clark cjclark@alum.mit.edu To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message