Results 1 to 6 of 6

Thread: What updates resolv.conf?

  1. #1
    Join Date
    Jun 2008
    Location
    Kentucky, USA
    Posts
    492

    Default What updates resolv.conf?

    I recently had problems with my internet connection. A bit of background: openSUSE 11.4 RC1, installed on external test drive, compiled broadcom wl module (working). I had been using it for a few days at home with wireless connection with no problems. On a whim, decided to take external drive to work and boot it from work machine. Totally different hardware/PC, but everything worked 100% after long boot (awesome!). Office PC's are on company network with static IP's (wired). It had no problems in negotiating connection. Flash forward to today: Returned home, booted external drive on PC used for original install (laptop) and worked 100% again except for internet. Wireless said connected, but couldn't browse or ping. After a few minutes of investigation, I found the problem to be resolv.conf. It still was using nameservers from work. I tried to update it with netconfig, but it only created a new file called resolv.conf.netconfig. I deleted both, rebooted, and wireless worked fine with a correct nameserver automatically in resolv.conf. If you made it through all of that, my question is, what is supposed to update resolv.conf? Why did networkmanager not update it when I reconnected to wifi at home? Which file superceeds the other, .conf or .conf.netconfig?
    Klaatu Barada Nikto

  2. #2
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,500
    Blog Entries
    48

    Smile Re: What updates resolv.conf?

    So, I am not sure this is the answer but I found a suggestion that you could run the following command to update this file:

    Code:
    sudo /sbin/netconfig update -f
    Perhaps this is one difference between a live CD and a static installation. Maybe if you ran this command at startup, you would be able to move the drive back and forth. By the way, you know they have the very small 2.5" external USB hard drives that run from the five volts in the USB connection and thus do not need a power brick to run. I use one for openSUSE for my work Laptop, but I always used it on the same computer and have not switched it around before.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  3. #3
    Join Date
    Jun 2008
    Location
    Kentucky, USA
    Posts
    492

    Default Re: What updates resolv.conf?

    Reading your post gave my brain a jolt. I didn't think to check the netconfig manpage. Running the -f argument will replace the existing resolv.conf instead of creating resolv.conf.netconfig. That will definitely help with hotplugging the drive on different systems. I think the problem was the fact that the wired connection at work was initiated via netconfig/ifup/etc... at boot, and everything updated accordingly (ie resolv.conf). The wireless connection couldn't do this since it had to wait for authorization after boot and nothing was updated via networkmanager. Adding a startup script or just the netconfig update -f command to /etc/rc.d/boot.local should take care of this problem. It is actually an external seagate usb drive, so it runs from usb port. I am trying to make it portable for rescue/repair, so I'm testing all the kinks involved with doing so. Thanks for the jolt.
    Klaatu Barada Nikto

  4. #4
    Join Date
    Mar 2010
    Location
    Austin - Texas
    Posts
    10,500
    Blog Entries
    48

    Smile Re: What updates resolv.conf?

    Reading your post gave my brain a jolt. I didn't think to check the netconfig manpage. Running the -f argument will replace the existing resolv.conf instead of creating resolv.conf.netconfig. That will definitely help with hotplugging the drive on different systems. I think the problem was the fact that the wired connection at work was initiated via netconfig/ifup/etc... at boot, and everything updated accordingly (ie resolv.conf). The wireless connection couldn't do this since it had to wait for authorization after boot and nothing was updated via networkmanager. Adding a startup script or just the netconfig update -f command to /etc/rc.d/boot.local should take care of this problem. It is actually an external seagate usb drive, so it runs from usb port. I am trying to make it portable for rescue/repair, so I'm testing all the kinks involved with doing so. Thanks for the jolt.
    Happy to help 67GTA. That external USB hard drive is what got me using openSUSE way back in 2005 and openSUSE 10 as I remember. I figured out how to boot from an external USB hard drive so that I could leave my work laptop hard drive untouched. Been using openSUSE ever since and it certainly has changed a lot since then. That external hard drive was an 80 GB size (compared to the 40 GB internal at the time) and cost me an arm and a leg. They are way cheaper these days as I purchased a 2.5" 500 GB for a mere $80 US on sale. It is hard to imagine how cheap they have become.

    Thank You,
    My Blog: https://forums.opensuse.org/blogs/jdmcdaniel3/

    Software efficiency halves every 18 months, thus compensating for Moore's Law

    Its James again from Austin, Texas

  5. #5
    Join Date
    Sep 2010
    Location
    Poland
    Posts
    1,721

    Default Re: What updates resolv.conf?

    Quote Originally Posted by 67GTA View Post
    Reading your post gave my brain a jolt. I didn't think to check the netconfig manpage. Running the -f argument will replace the existing resolv.conf instead of creating resolv.conf.netconfig. That will definitely help with hotplugging the drive on different systems. I think the problem was the fact that the wired connection at work was initiated via netconfig/ifup/etc... at boot, and everything updated accordingly (ie resolv.conf). The wireless connection couldn't do this since it had to wait for authorization after boot and nothing was updated via networkmanager. Adding a startup script or just the netconfig update -f command to /etc/rc.d/boot.local should take care of this problem. It is actually an external seagate usb drive, so it runs from usb port. I am trying to make it portable for rescue/repair, so I'm testing all the kinks involved with doing so. Thanks for the jolt.
    I find the way openSUSE handles resolv.conf quite confusing. Normally my /etc/resolv.conf is modified every time I switch a NetworkManager profile but once I switch to ifup the behavior changes and after switching back to NetworkManager the /etc/resolv.conf is not modified when switching profiles. There are some settings for this in the same YAST window that You switch from ifup to NetworkManager network controll (the 3rd tab from the left as far as I can remember) but I've got no idea what and where they change. Maybe tweaking those settings will solve this problem but I haven't tried this yet as I rarely use ifup. And if I encounter the problem I just delete the /etc/resolv.conf file and click on the appropriate NetworkManager profile.

    Best regards,
    Greg
    Best regards,
    Greg
    Box: Windows 7 / Windows XP | Intel Dual-Core E5200 | ATI Radeon HD4850 | 4GB RAM
    Lap: openSUSE 12.3 / Windows 7 | Intel U7300 | KDE | Intel GMA 4500 | Asus UL80A | 3GB RAM

  6. #6

    Default Re: What updates resolv.conf?

    Quote Originally Posted by 67GTA View Post
    If you made it through all of that, my question is, what is supposed to update resolv.conf?
    A DHCP request and response from the DHCP server update /etc/resolv.conf. Despite its extension, this file includes runtime settings rather than permanent configuration. If you want to use fixed DNS with dynamic IPs, you can write them in the variable NETCONFIG_DNS_STATIC_SERVERS in the file /etc/sysconfig/network/config.

Posting Permissions

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