Red Hat Bugzilla – Bug 675325
Changes to networking always clear the contents of resolv.conf
Last modified: 2012-02-21 00:03:34 EST
Description of problem: When RHEV-H is installed on a multiple-NIC machine, and only one NIC is configured at install time, the remaining, unconfigured NICs will cause resolv.conf to be overwritten anytime a change is made to networking. Version-Release number of selected component (if applicable): 2.2 How reproducible: Very Steps to Reproduce: 1. Install RHEV-H on a system with multiple nics. Only configure one nic at install time, the rhevm connection. Make sure to add DNS entries at that point. All other nics left un-configured. 2. Logon to RHEV-H system, cat /etc/resolv.conf, and run "ifup ethX" for any nic that was left unconfigured. 3. Once the int is up, cat /etc/resolv.conf, and run "ifdown ethX" on the same interface. Actual results: Either the up or the down will effectively end up wiping out the /etc/resolv.conf file. This appears to happen because the rhevm interface replaces the initial resolv.conf, which is blank and from the live iso image, when it first gets it's configuration. The subsequent ifup and ifdown on the eth interfaces, which also seems to happen when using RHEV-M to configure networking, execs the ifup-post and ifdown-post scripts. There's an if stanza in that file that modifies the resolv.conf if PEERDNS=no or RESOLV_MODS is set and not "no". Expected results: resolv.conf shouldn't be affected Additional info: At this point, it's not clear why RESOLV_MODS is set. Adding "PEERDNS=no" to the ifcfg-ethX files prevents all of this. Since only rhevm should usually have a DNS entry, a valid solution might be to change the ovirt-network-config utility to add in the PEERDNS=no for all unconfigured interfaces, and likely even all eth interfaces, since DNS should be set via rhevm interface.
*** Bug 679876 has been marked as a duplicate of this bug. ***
Created attachment 498115 [details] Patch Adds PEERDNS to all ifcfg-eth* scripts.
Tested on rhev-hypervisor-5.7-20110622.0.el5, change networking still clear resolv.conf, steps as below: 1. configure the nic eth0 and add dns entry (192.168.20.55) during install, other nics were not configured. reboot and check /etc/resolv.conf, dns entry (192.168.20.55) is there. 2. Check ifcfg-eth*, "PEERDNS=no" is added to unconfigured nics but not the configured nic eth0. 3. Enter "setup" and configure eth1, configured dns (192.168.20.3) at this time too. after network configuring finish, check /etc/resolv.conf, dns entry (192.168.20.3) is there. If choose not configured dns, after network configuring finish, /etc/resolv.conf is empty. 4. Check ifcfg-eth1, "PEERDNS=no" is removed, but added to ifcfg-eth0. It should be "PEERDNS=no" is removed while configured the new nic.
Original case is solved and reconfiguring can be moved to 5.8/5.7.z
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: When the hypervisor was installed on a machine with multiple Network Interface Cards (NICs), and only one NIC wass configured at install time, the resolv.conf file would be overwritten each time a change was made to networking. The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1 +1 @@ -When the hypervisor was installed on a machine with multiple Network Interface Cards (NICs), and only one NIC wass configured at install time, the resolv.conf file would be overwritten each time a change was made to networking. The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.+The /etc/resolv.conf file was being overwritten every time a change was made to networking. The statement PEERDNS="no" is now added to all interface configuration (ifcfg*) files created by the hypervisor. This prevents the incorrect overwriting of the resolv.conf file.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHSA-2012-0168.html