Bug 102394 - [dhclient] resolv.conf issue
Summary: [dhclient] resolv.conf issue
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: dhcp
Version: 9
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Daniel Walsh
QA Contact:
Keywords: FutureFeature
Depends On:
TreeView+ depends on / blocked
Reported: 2003-08-14 18:20 UTC by Dan Morrill
Modified: 2007-04-18 16:56 UTC (History)
0 users

Clone Of:
Last Closed: 2003-08-22 19:07:25 UTC

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:566 normal SHIPPED_LIVE Updated dhcp and dhclient packages 2005-05-26 04:00:00 UTC

Description Dan Morrill 2003-08-14 18:20:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030625
Mozilla Firebird/0.6

Description of problem:
*Note: this is not a bug in dhcp, this is a bug in dhclient. However,
there appears to be no dhclient package in the Bugzilla list, so I
chose this as a best guess.*

When dhclient updates /etc/resolv.conf, it overwrites whatever is there
with no opportunity to include or preserve any of its contents. In
some cases, network admins set up DHCP systems to exist in a separate
subdomain:  e.g. if the organization's domain is "somedomain.tld",
then they might use "foo.somedomain.tld" for static IP addresses, and
"foo.dhcp.somedomain.tld" for DHCP-assigned addresses.  In this case,
/etc/resolv.conf should include "search" entries for both
"somedomain.tld" and "dhcp.somedomain.tld".  However,
/sbin/dhclient-script will only add "somedomain.tld".

See the attached patch, which is a trivial modification to
/sbin/dhclient-script to include the contents of
/etc/sysconfig/resolv.conf in /etc/resolv.conf, if and only if the
file in sysconfig exists.  Please include this patch or another like
it in the next build of dhclient RPM.

Thanks! - Dan Morrill

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. echo "search dhcp.somedomain.tld" >> /etc/resolv.conf
2. ifdown eth0; ifup eth0 # if eth0 is a DHCP interface
3. observe that dhcp.somedomain.tld is no longer in resolv.conf

Actual Results:  /sbin/dhclient-script overwrites /etc/resolv.conf w/ no
mechanism to include arbitrary lines in it.

Expected Results:  There needs to be a way to include persistent lines in
/etc/resolv.conf (esp. "search" entries.)

Additional info:

--- dhclient-script     2003-08-14 13:55:42.000000000 -0400
+++ /sbin/dhclient-script       2003-08-14 13:56:34.000000000 -0400
@@ -24,6 +24,9 @@
 function make_resolv_conf() {
   if [ -n "$new_domain_name" ] || [ -n "$new_domain_name_servers" ]; then
     echo '; generated by /sbin/dhclient-script' > /etc/resolv.conf
+    if [ -f /etc/sysconfig/resolv.conf ]; then
+       cat /etc/sysconfig/resolv.conf >> /etc/resolv.conf
+    fi
     if [ -n "$new_domain_name" ]; then
        echo search $new_domain_name >> /etc/resolv.conf

Comment 1 Daniel Walsh 2003-08-22 19:07:25 UTC
Instead of adding your patch I added a variable SEARCH that can be set in the
ifcfg-* file.  If this is set then it will be added to the /etc/resolv.conf, 
otherwise it will work as it currently does.

So if you were using eth0 you could add the following to it
SEARCH="somedomain.tld foo.dhcp.somedomain.tld"

Available in dhcp-3.0pl2-6.13.src.rpm.

Comment 2 John Flanagan 2004-12-21 19:42:20 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Note You need to log in before you can comment on or make changes to this bug.