Bug 111208

Summary: dhclient ignores supersede when overwriting resolv.conf
Product: [Retired] Red Hat Raw Hide Reporter: Need Real Name <aewell>
Component: dhcpAssignee: Jason Vas Dias <jvdias>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: dhclient-3.0.1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-08-20 14:57:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

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,
--Tony
aewell

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

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


Version-Release number of selected component (if applicable):
DHCP-client-3.0pl1-1cra.i386.rpm

How reproducible:
Always

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. 

Dan

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
         Subject: Re: Need DNS help 
         In-Reply-To: Message from Anthony Ewell <aewell> 
         Date: Fri, 24 Aug 2001 19:39:16 -0400
         From: Ted Lemon <mellon>

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

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.

--Tony
aewell

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 
/etc/dhclient-${interface}.conf
(eg. /etc/dhclient-eth0.conf if eth0 is the interface being configured
 with DHCP - NOT /etc/dhclient.conf - this file is never used).