Bug 228200 - PEERDNS=no not honored in /etc/sysconfig/network-scripts/ethX
Summary: PEERDNS=no not honored in /etc/sysconfig/network-scripts/ethX
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: dhcp
Version: 4.4
Hardware: i386
OS: Linux
medium
low
Target Milestone: ---
: ---
Assignee: David Cantrell
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-02-11 12:20 UTC by Need Real Name
Modified: 2008-09-29 17:09 UTC (History)
2 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2008-09-29 17:09:04 UTC


Attachments (Terms of Use)

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 Product and 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


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