Red Hat Bugzilla – Bug 111208
dhclient ignores supersede when overwriting resolv.conf
Last modified: 2007-04-18 12:59:52 EDT
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
My /etc/dhclient.conf (local domain name changed):
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):
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
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.
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.)
Subject: Re: Need DNS help
In-Reply-To: Message from Anthony Ewell <firstname.lastname@example.org>
Date: Fri, 24 Aug 2001 19:39:16 -0400
From: Ted Lemon <email@example.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 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.
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.
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).