Bug 178045

Summary: dhcleint-script overwrites custom resolv.conf
Product: [Fedora] Fedora Reporter: Jeff Armstrong <stretcharmy1>
Component: dhcpAssignee: Jason Vas Dias <jvdias>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-01-17 16:29:59 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 Jeff Armstrong 2006-01-17 16:14:51 UTC
Description of problem: dhclient-script overwrites custom resolv.conf file. 
Server uses dhcp external interface and static internal interfaces.  We use
internal dns.  dhclient-script overwrites search and domain with external
information.


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


How reproducible: restart network when address is obtained it will overwrite file


Additional info:  It would be nice if there was a settings file or something
besides editing out the dhclient-script. Or have the rpm save the file as rpmnew
instead of overwriting changes.  I know it's minor.  But i'm guessing there is
more than just me with this problem.

Comment 1 Jason Vas Dias 2006-01-17 16:29:59 UTC
There are many ways to customize the dhclient-script's modification of 
resolv.conf:

o  Disable resolv.conf modification entirely - set
   'PEERDNS=no'
   in /etc/sysconfig/network, or /etc/sysconfig/network-scripts/ifcfg-${IF}

OR

o  Change the domain-name or domain-name-servers dhcp options in 
   /etc/dhclient.conf (see man dhclient.conf(5)) with the 'prepend',
   'append', or 'supersede' directives - e.g.:
     'supersede domain-name-servers W.X.Y.Z;'
   will replace any nameservers received from dhcp with W.X.Y.Z .
   If dhclient-${interface}.conf exists for the $interface being configured,
   it will override any existing global dhclient.conf.

OR

o  Create an /etc/dhclient-up-hooks script, that will be sourced before
   dhclient writes resolv.conf, so you can change dhcp option settings 
   before they are written:
     '...new_domain_name_servers=$my_nameserver;...'
   See 'man dhclient-script' for details on the dhclient hooks scripts.

In short, dhclient-script is NOT a %config file and should never need to
be modified by end users, and there are many methods provided to customize its
operation, so this is 'NOTABUG'. If you still have problems, let me know .
Thank you!