Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: Resolv.conf overwritten by Network Manager wipes my settings

  1. #1
    Join Date
    Jan 2010
    Beans
    12

    Resolv.conf overwritten by Network Manager wipes my settings

    Hello,

    I have connected my girlfriend's laptop to a university network (in halls/dorms) and have had to make some manual changes to /etc/network/interfaces (for static IP purposes) and /etc/resolv.conf (to enter DNS server info). Everything was working great with these settings, but after leaving her room, accessing wireless in the library, and then returning to her hardwired connection, her internet no longer works.

    When I went back to the resolv.conf file, I found that all of my changes were deleted and replaced with something to the effect of 'Settings managed by Network Manager'. It appears that Network Manager is overwriting the settings I made in resolv.conf. Re-entering this information solves the problem, but I would not expect my girlfriend to have to do this every time she wants to access the internet.

    The computer must be on a static IP when connected via cable, as it needs to connect to the university's DNS servers. I don't believe uninstalling Network Manager is the way forward, because I worry that my g/f won't be able to easily switch between wireless and hardwired as the need arises.

    Does anyone know how to resolve this issue? How can I keep my resolv.conf file from being overwritten regularly by Network Manager? I read somewhere that entering 'ifdown eth0' in Terminal, making the changes to the resolv.conf file and then going back into Terminal and entering 'ifup eth0', the problem can be solved. Has anyone else had any luck with this. Any help would be greatly appreciated.

  2. #2
    Join Date
    Jan 2009
    Beans
    Hidden!

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    To prevent resolv.conf from being overwritten, do
    Code:
    sudo chattr +i /etc/resolv.conf

  3. #3
    Join Date
    Jan 2010
    Beans
    12

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    Thanks, I'll try that. Would you mind providing me with the code to reverse that command if, for some reason in the future, I ever want the resolv.conf to be overwritten?

    I look forward to any other solutions others might have and appreciate the assistance. We had so many problems getting my girlfriend's new laptop up and running. We've had a lot of issues with Windows 7 incompatibilities with her model of Toshiba laptop. A reinstall of Vista did not work, and I do not want to have to resort to XP. She's extremely happy with Ubuntu (which makes me happy), and I would hate to have to move back to XP (especially on a laptop that's less than four months old) just so she can have a stable internet connection experience.

    Cheers!
    Last edited by mac1984user; January 13th, 2010 at 12:32 PM.

  4. #4
    Join Date
    Jan 2009
    Beans
    Hidden!

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    for reverting that
    Code:
    sudo chattr -i /etc/resolv.conf

  5. #5
    Join Date
    Dec 2009
    Location
    Chennai, India
    Beans
    117

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    Hi,

    You can mention your DNS servers in /etc/network/interfaces file as shown below. You will need to install resolvconf package for these DNS settings to work. In this approach, you do not need to add any DNS server entries to /etc/resolv.conf file manually.

    1) # sudo apt-get install resolvconf

    2) Add the following 2 lines in /etc/network/interfaces file under your configuration for your interface(eth0?):

    dns-nameservers x.x.x.x y.y.y.y
    dns-search xyz.com

    Reboot your machine and see if these DNS servers are added automatically to your /etc/resolv.conf file.

    Since your wireless interface will continue to be managed by the NetworkManager, there should not be any problem when you are using Wireless instead of the wired connectivity.

    Let me know if this helps.

  6. #6
    Join Date
    Jan 2010
    Beans
    12

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    Hello,

    Unfortunately, none of the solutions offered above worked properly. Suseendran, resolvconf installed fine, but the changes to the interfaces file were not automatically ported over to the resolv.conf file after boot-up, so I was faced with the same problem. I decided to uninstall resolvconf as it was more difficult to change settings than it was to simply make a few changes in the resolv.conf file (at least I can GET internet somehow). It's just inconvenient whenever I detach wired ethernet, go to a wireless hotspot and come back to find that all the resolv.conf files were deleted by network manager.

    x33a, your solution was quite good in the sense that it certainly kept network manager from overwriting the resolv.conf file. Every time I wanted to use the wired ethernet, it connected without fail. However, when I went to a wireless hotspot, wireless could not connect because Network Manager could not alter the resolv.conf file to include the IP address produced by the wireless connection. So I was stuck in a SECOND quandry. It's really frustrating, but I appreciate the suggestions.

    So, basically, I'm back to square one. I tried to just enter in the same DNS server names and the fixed IP address directly into Network Manager, but that didn't work either. If my girlfriend never leaves the desk in her room, her wired ethernet works fine. If, however, she needs to go to the library or to class with her laptop and connects to the wireless internet, upon returning to her room, she now has to manually edit the resolv.conf file every time she wants to access the internet. She's probably less bothered about it than I am, but it seems a bit ridiculous that she can't simply choose to use wireless one minute and wired the next without so much hassle. I'm really pissed off with Toshiba for selling a laptop with a crap BIOS that doesn't accept Windows 7 installations. We literally bought it AFTER Windows 7 was released. If you go on the website, the Satellite Pro L300D is STILL shipped with Windows Vista 32-Bit, but now they advertise it as having an updated BIOS. Go figure! Ridiculous. We both love Ubuntu so much, but I just don't know how to get around this one issue. Any further advice would be greatly appreciated.

  7. #7
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    If the connection were via DHCP, I'd suggest using the "prepend" option in /etc/dhcp3/dhclient.conf.
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  8. #8
    Join Date
    Jan 2010
    Beans
    12

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    If only it were a connection through DHCP... my life would be so much easier.

  9. #9
    Join Date
    Jan 2006
    Location
    Not heaven... Iowa
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    Some background information... what static address setting is it that won't work via Network Manager's manual setting?
    Linux User #415691 Ubuntu User #8629
    Iowa Team (LoCo): [Wiki] [Launchpad]
    IRC channel: #ubuntu-us-ia on irc.freenode.net

  10. #10
    Join Date
    Jan 2010
    Beans
    12

    Re: Resolv.conf overwritten by Network Manager wipes my settings

    Hello,

    I'm not certain why it's not working in Network Manager; I think it's because I need more information than Network Manager has fields for. This computer network needs a specific computer name, a network address, subnet mask, gateway, fixed IP, and three specific DNS servers. So, the only way to include all this information is to go into both the /etc/network/interfaces file to include the search domain, the static IP address, gateway, network, subnet, etc. Then I have to go into the /etc/resolv.conf to add the DNS servers.

    When I enter the DNS servers into Network Manager, it doesn't add them to the resolv.conf file and I cannot access the internet. So trying to get these settings to work within the GUI just doesn't seem possible. Should I delete network manager? In so doing, would I lose the ability to access wireless signal and connect to wired ethernet? Is there an alternative to Network Manager that offers more settings? When I can get back to that computer, I'll post the details of what's required by the school network.

    Cheers

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

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