Bug 455825 - NetworkManager messes up /etc/resolv.conf even when disabled
NetworkManager messes up /etc/resolv.conf even when disabled
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: NetworkManager (Show other bugs)
9
x86_64 Linux
low Severity low
: ---
: ---
Assigned To: Dan Williams
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-17 22:39 EDT by Tom Lane
Modified: 2013-07-02 23:19 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-18 13:33:46 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 Tom Lane 2008-07-17 22:39:28 EDT
Description of problem:
NetworkManager overwrites /etc/resolv.conf with a nonfunctional configuration at boot,
even though it's supposedly turned off.

Version-Release number of selected component (if applicable):
NetworkManager-0.7.0-0.9.4.svn3675.fc9.x86_64

How reproducible:
100%

Steps to Reproduce:
1.  sudo /sbin/chkconfig NetworkManager off
2.  correctly configure /etc/resolv.conf
3.  reboot
4.  notice /etc/resolv.conf has been trashed.
  
Actual results:
# generated by NetworkManager, do not edit!



# No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# SEARCH=lab.foo.com bar.foo.com

Expected results:
I'd like my configuration left alone, thank you very much.
Or at least set to what I have specified in the ifcfg-xxx files.

Additional info:
The mod timestamp on the overwritten file seems impossibly early, like before any of userland has started.
Don't tell me the kernel is invoking NetworkManager before anything else?
Comment 1 Dan Williams 2008-07-18 13:33:46 EDT
NM will never overwrite resolv.conf if NM isn't not active.  And NM will respect
whatever you have in your ifcfg files, as long as you've told NM to manage that
device.  Since at some point you ran NetworkManager, and apparently
NetworkManager was not connected to anything when you shut down, your
resolv.conf is no longer valid.

The problem here is that resolv.conf is not static.  When you connect to a VPN,
you want that VPN's nameservers merged into your resolv.conf, otherwise it would
be pointless to connect to the VPN.  But you don't want those VPN nameservers
present when you're not connected to the VPN, otherwise you won't be able to
resolve anything.  _Something_ needs to modify resolv.conf and update it with
the correct DNS information.  If the system-config-network scripts kept a
canonical copy of the resolv.conf file somewhere, we could make NetworkManager
restore that copy when it shuts down.  But as long as /etc/resolv.conf is the
only canonical source for DNS information, there's not much you can do when you
have to update it with new info.

So in short, NM isn't messing up resolv.conf when it's not running.  It's
because you turned NM off that your resolv.conf isn't getting updated any more.
 When you change your network configuration (such as turning NM off) you'll also
need to make sure your resolv.conf is correct.
Comment 2 Tom Lane 2008-07-18 16:02:25 EDT
I did *not* run NM, at least not intentionally, and I can't find any part of the system startup scripts that 
invoked it either.  If you can tell me where to deactivate it so it stays deactivated, I'd be happy.

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