Bug 228200 - PEERDNS=no not honored in /etc/sysconfig/network-scripts/ethX
PEERDNS=no not honored in /etc/sysconfig/network-scripts/ethX
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dhcp (Show other bugs)
4.4
i386 Linux
medium Severity low
: ---
: ---
Assigned To: David Cantrell
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2007-02-11 07:20 EST by Need Real Name
Modified: 2008-09-29 13:09 EDT (History)
2 users (show)

See Also:
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 13:09:04 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Need Real Name 2007-02-11 07:20:10 EST
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 14:40:57 EST
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-23 20:49:48 EDT
This can be fixed by adding:

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

To the make_resolv_conf() function in /sbin/dhclient-script.
Comment 5 RHEL Product and Program Management 2008-09-23 21:02:27 EDT
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 13:09:04 EDT
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

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