Bug 228200

Summary: PEERDNS=no not honored in /etc/sysconfig/network-scripts/ethX
Product: Red Hat Enterprise Linux 4 Reporter: Need Real Name <ogyland>
Component: dhcpAssignee: David Cantrell <dcantrell>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 4.4CC: atodorov, pknirsch
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: dhclient-3.0.1-62.EL4 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-09-29 17:09:04 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 2007-02-11 12:20:10 UTC
Description of problem:

The PEERDNS=no option in /etc/sysconfig/network-scripts/ethX should leave
/etc/resolv.conf untouched when the network interface is (re)started. 

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

RHEL 4.4

How reproducible:


Steps to Reproduce:
1. type PEERDNS=no in /etc/sysconfig/network-scripts/ethX
2. shut down the network interface
3. start the network interface
  
Actual results:
/etc/resolv.conf is updated with info from dhclient

Expected results:
/etc/resolv.conf should have been left untouched.

Additional info:

I checked and ifup recognizes the PEERDNS=no option

  if [ "${PEERDNS}" = "no" ]; then
       # Do not update/replace resolv.conf.
        PUMPARGS="${PUMPARGS} -d"
        DHCPCDARGS="${DHCPCDARGS} -R"


[root@skrot ~]# cat /etc/resolv.conf
search intern.lan
nameserver 127.0.0.1
nameserver 62.179.100.29
nameserver 62.179.100.30
nameserver 212.83.64.138

[root@skrot ~]# ifdown eth1
[root@skrot ~]# ifup eth1

Determining IP information for eth1... done.
[root@skrot ~]# cat /etc/resolv.conf
search upc.no
nameserver 62.179.100.29
nameserver 62.179.100.30
nameserver 212.83.64.138

[root@skrot ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
# 3Com Corporation 3c905 100BaseTX [Boomerang]
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=dhcp
PEERDNS=no
TYPE=Ethernet

[root@skrot ~]# rpm -q dhclient
dhclient-3.0.1-58.EL4

Comment 1 Need Real Name 2007-02-14 19:40:57 UTC
The problem is not only related to ifup, each time dhclient renews the dhcp
lease /etc/resolv.conf is updated. I have another Fedora 5 machine with the same
setup in /etc/sysconfig/network-scripts/ethX and it works as expected on that
machine.

Comment 4 David Cantrell 2008-09-24 00:49:48 UTC
This can be fixed by adding:

[ "${PEERDNS}" = "no" ] && return

To the make_resolv_conf() function in /sbin/dhclient-script.

Comment 5 RHEL Program Management 2008-09-24 01:02:27 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 6 Alexander Todorov 2008-09-29 17:09:04 UTC
from /sbin/dhclient-script:

make_resolv_conf() {
  if [ "${PEERDNS}" == "no" ]; then  
      return 
  fi
... skip ...

and I can't reproduce it. This is with 4.7 GA/dhclient-3.0.1-62.EL4