Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently upgraded from 11.10 to 12.04, and now NetworkManager isn't populating /etc/resolv.conf when connecting to wireless networks, when it had been working perfectly in 11.10. I'm not seeing any explicit errors in either the NM UI or in syslog. How do I diagnose what's wrong?

Edit: If I try to run resolvconf, I get the error "resolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything." What should it be a symlink to and/or how do I get NM to populate it? This says the symlink should point to /run/resolvconf/resolv.conf, but that file does not exist on my system.

share|improve this question
add comment

4 Answers 4

up vote 37 down vote accepted

Use following command and answer YES to enable dynamic updates:

sudo dpkg-reconfigure resolvconf

Worked for me on Ubuntu 12.04.

share|improve this answer
    
Worked perfectly. Have an old laptop with 12.04 a dead battery that I unplugged by accident. Could ping my home router but not get web pages. Oddly could access other wifi network. This gave me access through home network again. –  Mark D Sep 18 '12 at 4:06
    
The question remains: Why was the symlink missing? This question is being addressed in bug #1000244 (bugs.launchpad.net/ubuntu/+source/resolvconf/+bug/1000244). See comment #66 for my best guesses about the various causes of this problem. –  jdthood Oct 28 '12 at 20:47
    
I had the same problem in 13.04 (out of thin air, NOT a new install), this solution worked for me to. –  Radu Maris Sep 24 '13 at 7:44
1  
I wish there was a 'tip' or 'buy-me-a-beer' button on stack-exchange for thanking people. –  Christopher Pfohl Oct 23 '13 at 13:51
add comment

I had the same problem. Seems that Ubuntu is using a local resolver now. The fastest way to remove that is to comment out the following line in /etc/NetworkManager/NetworkManager.conf:

#dns=dnsmasq

For more information, please take a look at this page.

share|improve this answer
1  
Disabling that line and then restarting NM has no noticeable effect for me. The error still occurs and NM still refuses to populate resolv.conf. –  Cerin May 15 '12 at 22:38
    
Did the trick for me. Thanks a lot! –  please delete me Aug 21 '13 at 21:23
1  
Thanks for this information! I also had to restart the network manager: sudo /etc/init.d/network-manager restart. –  Ethan Leroy May 5 at 17:14
add comment

If /etc/resolv.conf is a file then move it to /run/resolvconf/resolv.conf :

sudo mv /etc/resolv.conf /run/resolvconf/resolv.conf

Then create the symlink:

sudo ln -s ../run/resolvconf/resolv.conf /etc/resolv.conf
share|improve this answer
1  
This helps. But easier and more reliable (typos) way for doing that is sudo dpkg-reconfigure resolvconf and answer YES. –  geekQ Mar 28 '13 at 9:17
    
This is a great method if you're going to do dpkg-reconfigure resolvconf --frontend=noninteractive followed up resolvconf -u. If you don't move the file and symlink first, an unattended dpkg-reconfigure will fail because /etc/resolv.conf is not a symlink. –  sidewaysmilk Feb 19 at 21:17
add comment

Had since a loooong time problems with my laptop, had to

sudo dhclient wlan0 

to be able to make the web work. Found that the resolv.conf was not updated by the network manager, and finally the

sudo dpkg-reconfigure resolvconf

solved my problem!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.