Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Dec 2002 21:31:53 -0500
From:      David Hovemeyer <daveho@cs.umd.edu>
To:        freebsd-bugs@freebsd.org
Subject:   bug in /sbin/dhclient-script?
Message-ID:  <20021210023152.GB1741@cs.umd.edu>

next in thread | raw e-mail | index | archive | help

--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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021210023152.GB1741>