Bug 111208 - dhclient ignores supersede when overwriting resolv.conf
Summary: dhclient ignores supersede when overwriting resolv.conf
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: dhcp   
(Show other bugs)
Version: 1.0
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2003-11-30 03:50 UTC by Need Real Name
Modified: 2007-04-18 16:59 UTC (History)
0 users

Fixed In Version: dhclient-3.0.1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-08-20 14:57:08 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

Description Need Real Name 2003-11-30 03:50:00 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5)
Gecko/20031007 Netscape/7.1 Firebird/0.7

Description of problem:
I just upgraded DHCP-client-3.0pl1-1cra.i386.rpm on a clients Red 
Hat 9 server.  eth1 is operating as a client from an Internet
provider.  eth0 uses dhcp-server-3.0pl1-1cra.i386.rpm as a DHCP 
server to all workstations on eth0.  The server also ruins its 
own named (DNS) server.

 Problem:  this version ignores my supersede commands in
/etc/dhclient.conf and consequently overwrites my /etc/resolv.conf
with my ISP's informations.  This really, really freaks out my 
Samba file server, which is set to resolve (/etc/resolv.conf) 
host names with my local name server.

  As a temporary solution, I commented out the commands in
/sbin/dhclinet-script: "function make_resolv_conf" and hand 
corrected /etc/resolv.conf.  

Many thanks,

My /etc/dhclient.conf (local domain name changed):

    prepend domain-name-servers;
    supersede domain-name "iamnottellingyou.com";
    supersede domain-name-servers;

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

How reproducible:

Steps to Reproduce:
1.  write a local DNS server into /etc/resolv.conf
2.  up and down your ethernet port connected to the internet
        ifdown eth1; ifup eth1    or similar
3.  check your /etc/resolv.conf, it will contain your ISP's DNS server

Additional info:

Comment 1 Daniel Walsh 2003-12-29 12:40:31 UTC
For situations like this it is better to set the PEERDNS=no flag in
your ifcfg files.  This will prevent the dhclient code from trying to
update the resolv.conf.  The client code is only built for the simple
case so handling complicated cases where there are multiple network
devices does not always work. 


Comment 2 Need Real Name 2004-01-01 00:35:24 UTC
Hi Dan,

     This is a portion of a letter Ted Lemon sent me.  He is the
original author of dhclient.  (Unfortunately, he is no longer 
its maintainer.  I have no clue who the current maintainer is.)

         To: dhcp-client@isc.org
         Subject: Re: Need DNS help 
         In-Reply-To: Message from Anthony Ewell <aewell@gbis.com> 
         Date: Fri, 24 Aug 2001 19:39:16 -0400
         From: Ted Lemon <mellon@nominum.com>

         > Is there a way to over ride this (my local DNS resolves names
         > from the Internet faster than my ISP's anyway -- has a much
         > smaller cache to deal with)?

         in your dhclient.conf:

                  supersede domain-name-servers;

Ted also wrote me recently that "supersede" was suppose to work, 
that the problem was a recent bug added to the code, and, 
unfortunately, he was no longer in a position to help.  (I did 
not save his letter.)

So, this really is a bug and really does need fixing.  The error is 
in whatever calls dhclinet-script's "function make_resolv_conf".

Please do not close or defer this bug until it is actually corrected.

Thank you for the work around.


Comment 3 Leonardo B. Morelli 2004-03-06 07:38:44 UTC
well, not from RH, but from Slackware - I discovered (man dhcpcd -
duh) that using the -R flag when calling dhcpcd will prevent it from
overwriting the resolv.conf file - and that should solve your
problems. Just add the -R flag wherever your system is calling dhcpcd
(/etc/rc.d/rc.inet1 in slack) and you are all set.

Comment 4 Jason Vas Dias 2004-08-20 14:57:08 UTC
dhclient-3.0.1-x (current version) now fully supports and honours
the supersede, prepend and append options when placed in 
(eg. /etc/dhclient-eth0.conf if eth0 is the interface being configured
 with DHCP - NOT /etc/dhclient.conf - this file is never used).

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