NetworkManager not populating resolv.conf
Solution 1
Use following command and answer YES to enable dynamic updates:
sudo dpkg-reconfigure resolvconf
Worked for me on Ubuntu 12.04.
Solution 2
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.
Solution 3
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
Solution 4
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!
Related videos on Youtube
Cerin
Updated on September 18, 2022Comments
-
Cerin over 1 year
I recently upgraded from
11.10
to12.04
, and nowNetworkManager
isn't populating/etc/resolv.conf
when connecting to wireless networks, when it had been working perfectly in11.10
. I'm not seeing any explicit errors in either theNetworkManager
,UI
or insyslog
. How do I diagnose what's wrong?Edit: If I try to run
resolvconf
, I get the errorresolvconf: Error: /etc/resolv.conf isn't a symlink, not doing anything.
What should it be, a
symlink
to and/or how do I getNetworkManager
to populate it? This says thesymlink
should point to/run/resolvconf/resolv.conf
, but that file does not exist on my system. -
Cerin almost 12 yearsDisabling that line and then restarting NM has no noticeable effect for me. The error still occurs and NM still refuses to populate resolv.conf.
-
Mark D over 11 yearsWorked 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.
-
jdthood over 11 yearsThe 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.
-
geekQ about 11 yearsThis helps. But easier and more reliable (typos) way for doing that is
sudo dpkg-reconfigure resolvconf
and answer YES. -
Chris Pfohl over 10 yearsI wish there was a 'tip' or 'buy-me-a-beer' button on stack-exchange for thanking people.
-
ErsatzRyan about 10 yearsThis is a great method if you're going to do
dpkg-reconfigure resolvconf --frontend=noninteractive
followed upresolvconf -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. -
Ethan Leroy about 10 yearsThanks for this information! I also had to restart the network manager:
sudo /etc/init.d/network-manager restart
. -
Reg Mem over 7 yearsI needed to do this even on Ubuntu 16.04 / Elementary OS 0.4 Loki
-
ASalazar over 7 yearsThis just happened to me on Ubuntu 16.10. The solution still works, although the dialog strongly suggests an immediate reboot. Edit: It happened out of the blue yesterday, more than a month after the upgrade.