From owner-freebsd-bugs Mon Dec 9 18:32: 2 2002 Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D054237B401 for ; Mon, 9 Dec 2002 18:32:00 -0800 (PST) Received: from noir.cs.umd.edu (noir.cs.umd.edu [128.8.128.25]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CA1743E4A for ; Mon, 9 Dec 2002 18:32:00 -0800 (PST) (envelope-from daveho@cs.umd.edu) Received: from noir.cs.umd.edu (localhost [127.0.0.1]) by noir.cs.umd.edu (8.12.5/8.12.5) with ESMTP id gBA2VrSx001837 for ; Mon, 9 Dec 2002 21:31:53 -0500 Received: (from daveho@localhost) by noir.cs.umd.edu (8.12.5/8.12.5/Submit) id gBA2VrUp001835 for freebsd-bugs@freebsd.org; Mon, 9 Dec 2002 21:31:53 -0500 Date: Mon, 9 Dec 2002 21:31:53 -0500 From: David Hovemeyer To: freebsd-bugs@freebsd.org Subject: bug in /sbin/dhclient-script? Message-ID: <20021210023152.GB1741@cs.umd.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline User-Agent: Mutt/1.4i Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline The problem: /sbin/dhclient-script does not update /etc/resolv.conf unless it receives a domain name from the DHCP server. My DSL router doesn't send a domain name. Hence, no /etc/resolv.conf file is created, and DNS doesn't work. I'm running 5.0 RC1, but the same problem exists in 4.6.2-RELEASE. My recollection is that 4.5-RELEASE worked fine without getting a domain name from the DHCP server. I've attached a trivial fix for the problem to this email. Basically, it creates /etc/resolv.conf as long as name servers are sent by the DHCP server. -Dave --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dhclient-script.patch" --- dhclient-script.orig Mon Dec 9 20:07:21 2002 +++ dhclient-script Mon Dec 9 20:11:08 2002 @@ -9,8 +9,12 @@ fi make_resolv_conf() { - if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then - echo search $new_domain_name >/etc/resolv.conf + if [ x"$new_domain_name_servers" != x ]; then + if [ "x$new_domain_name" != x ]; then + echo search $new_domain_name >/etc/resolv.conf + else + cat /dev/null > /etc/resolv.conf + fi for nameserver in $new_domain_name_servers; do echo nameserver $nameserver >>/etc/resolv.conf done --KsGdsel6WgEHnImy-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message