Network Manager overwrites resolv.conf
FedoraForum.org - Fedora Support Forums and Community
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 25
  1. #1
    leonloopik Guest

    Network Manager overwrites resolv.conf

    heey,
    I have a problem with NetworkManager.... becouse every time it overwrites resolv.conf
    I've searched around and i found a solution to set your dns servers in dhclient.conf, but that file not exist.
    I use the DNS servers from my isp becouse if it go's thru my router my internet is verry slow......

    thanks
    Leon
    -----------------
    Linux Newb..

  2. #2
    Join Date
    Jun 2004
    Location
    Maryland, US
    Posts
    7,577
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Are you implying it should not do that?

    NetworkManager is supposed to overwrite the resolv.conf, that's
    how it's designed to work. You don't have to use network manager,
    just turn it off and then configure your network as you want it.

    Mark

  3. #3
    Join Date
    Jul 2005
    Location
    Ft Huachuca, AZ
    Posts
    3,780
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Or you could go to system ->administration ->network, highlight your device, click edit and uncheck the box for "obtain dns information"

  4. #4
    Join Date
    Nov 2004
    Location
    Seymour, Indiana
    Posts
    2,509
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can set the file the way you want it and set it as read-only.

    Brian
    Distribution: RHEL 5.1 with Pieces of this and that.
    Kernel 2.6.23.9, KDE 3.5.8 and KDE 4.0 beta, Plus Development src.rpm, ATI fglrx64_7_1_0-8.433-1 rpm with 3D and DRI working.
    Acer 5100-5840 with webcam, ati, sdcard reader, sound, atheros based wireless, all working. Only thing not working is the memory stick reader.

  5. #5
    leonloopik Guest
    I already unchecked the box for "obtain dns information" but it doesnt work...
    i also read somwere that its not good to make the file read only.....
    But thanks for the reply's and I will keep searching and i hope one has a idea that works
    Leon

  6. #6
    Join Date
    Jul 2005
    Location
    Ft Huachuca, AZ
    Posts
    3,780
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The problem is NetwokManager. Disable the 2 NM services. Then configure the devices using:

    system-config-network

    Uncheck the boxes for "activate on boot" and add a check mark for "allow users to enable/disable device" and reboot. To bring the interface up, you will have to goto:
    system ->adminstration ->network, highlight the device and click "activate"

  7. #7
    bucky Guest
    In F9, you can use system-config-network to prevent a particular interface from being managed by NetworkManager, and then add a line that says PEERDNS=no to /etc/sysconfig/networking/devices/ifcfg-ethx

    The PEERDNS flag is the pre-NetworkManager way to do this the "right" way. NetworkManager is supposed to be respecting PEERDNS itself Real Soon Now.

    However, that day is not yet today. So there really is no "right" way to do it with NetworkManager.

    If you want to use NetworkManager (let's say it's a laptop, and you actually roam with it), BUT you don't want /etc/resolv.conf overwritten (let's say you're managing your own named service for sysadmin practice), you can do:

    $ sudo chattr +i /etc/resolv.conf

    ...to set the "immutable" flag. It works. It works simply. And it can be undone quickly when the "right" way is ready.

  8. #8
    Elrondo Guest
    Personnaly, i had no problem to modify the DNS directly in etc/resolv.conf with my connection managed with NetworkManager.
    NetworkManager doesn't seems overwrite this file more after configuring my connection.
    Just add your DNS in lines "DNS="

  9. #9
    Join Date
    May 2008
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    Hello all,
    I had the same problem.
    -1 turned off network manager don't like it on my servers, but works fine with my laptop.
    -2 my /etc/resolv.conf was still changed!
    -3 checked /etc/sysconfig/networking/profiles/default/resolv.conf this file was wrong and still had the tekst created by network manager in it.

    -4 made a copy (after changing) of /etc/resolv.conf to /etc/sysconfig/networking/profiles/default/resolv.conf

    -5 restarted my network -> service network restart
    -6 problem solved!

  10. #10
    cicatrix1 Guest
    Additionally, you can configure NetworkManager with any extra DNS servers etc. It seems to work OK.

  11. #11
    Join Date
    Apr 2006
    Location
    Rochester, NY
    Posts
    139
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bucky
    In F9, you can use system-config-network to prevent a particular interface from being managed by NetworkManager, and then add a line that says PEERDNS=no to /etc/sysconfig/networking/devices/ifcfg-ethx
    All my interfaces have "controlled by networkmanager" unchecked, and they all have PEERDNS=no, yet NetworkManager continues to overwrite my resolv.conf.
    Not only that, but with the NetworkManager service disabled and the "network" service enabled, NetworkManager is STILL somehow overwriting the correct settings with NOTHING:

    Code:
    # 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
    # DOMAIN=lab.foo.com bar.foo.com
    Last edited by BlueH2O; 8th October 2008 at 09:41 PM.

  12. #12
    thinkaboutit Guest

    Hack it

    Hi,

    I simply edited the string

    '# generated by NetworkManager, do not edit!'

    in the NetworkManager binary to my favoured name server, in this case

    'nameserver 127.0.0.1 #Manager, do not edit!'

    Works great! (Be sure to make a safety copy of the binary first...)

  13. #13
    Join Date
    Dec 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    overwrites of resolv.conf

    I had this problem as well.
    My /etc/resolv.conf file kept being overwritten on reboot with a message in it that said:
    # generated by NetworkManager, do not edit
    I had already turned off NetworkManager as a service entirely, so I removed it too:
    rpm -e NetworkManager NetworkManager-...
    but the /etc/resolv.conf kept being overwritten on reboot with that "generated by NetworkManager" message in it! WTH?

    It turns out that if you have a file called /etc/resolv.conf.save, it overwrites /etc/resolv.conf on reboot. There are a number of scripts that will generate a /etc/resolv.conf.save. I blew away my /etc/resolv.conf.save and now everything works. It really was not a NetworkManager problem.

  14. #14
    normyzo Guest
    Quote Originally Posted by Kludge
    I had this problem as well.
    My /etc/resolv.conf file kept being overwritten on reboot with a message in it that said:
    # generated by NetworkManager, do not edit
    I had already turned off NetworkManager as a service entirely, so I removed it too:
    rpm -e NetworkManager NetworkManager-...
    but the /etc/resolv.conf kept being overwritten on reboot with that "generated by NetworkManager" message in it! WTH?

    It turns out that if you have a file called /etc/resolv.conf.save, it overwrites /etc/resolv.conf on reboot. There are a number of scripts that will generate a /etc/resolv.conf.save. I blew away my /etc/resolv.conf.save and now everything works. It really was not a NetworkManager problem.
    NetworkManager will get DNS information where you tell it to get DNS from; you can either enter the DNS servers manually into your /etc/sysconfig/network-scripts/ifcfg-* files with the keys DNS1, DNS2, DNS3 (which NM will pick up and use automatically if the device is managed by NM), or you can use nm-connection-editor to add your preferred DNS servers to the connection.

  15. #15
    arvinddeshpande Guest
    All along I was thinking dhcp-client does that.....whenever it gets information about the interface such as DNS servers, ip information etc. No?

Page 1 of 2 1 2 LastLast

Similar Threads

  1. resolv.conf ignores hosts file. host.conf is correct
    By mlee07946 in forum Servers & Networking
    Replies: 2
    Last Post: 17th September 2013, 08:37 PM
  2. Samba SWAT - Creating New Share Overwrites Previous ones in smb.conf
    By AoiShikaku in forum Servers & Networking
    Replies: 4
    Last Post: 24th July 2008, 05:05 PM
  3. vpnc + networkmanager overwrites the resolv.conf
    By gregor2005 in forum Servers & Networking
    Replies: 2
    Last Post: 16th January 2008, 02:03 AM
  4. Network manager keep messin up resolv..conf
    By chriske21 in forum Servers & Networking
    Replies: 6
    Last Post: 13th January 2008, 01:31 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •