43

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 NetworkManager, 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 NetworkManager to populate it? This says the symlink should point to /run/resolvconf/resolv.conf, but that file does not exist on my system.

Cerin
  • 6,923

5 Answers5

72

Use following command and answer YES to enable dynamic updates:

sudo dpkg-reconfigure resolvconf

Worked for me on Ubuntu 12.04.

16

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.

Eliah Kagan
  • 119,640
5

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
jdthood
  • 12,625
stolen
  • 59
1

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!

0

If you are on the (right) way of getting rid of systemd and uninstalled systemd-resolved you probably want this in your /etc/NetworkManager/NetworkManager.conf:

[main]
dhcp=dhclient
dns=default
rc-manager=resolvconf
systemd-resolved=false

Refer to man NetworkManager.conf for tweaking the above parameters according to your setup.

midenok
  • 848
  • 1
  • 10
  • 15