Solving weird DNS resolv.conf issues on Ubuntu using the resolvconf service

Ubuntu has this fancy system where by /etc/resolv.conf isn’t actually a proper resolver but refers to a local server called To be honest this is just a pain in certain circumstances because you lose control.

To see the mess, you can just start googling. You end up with 100s answers.

So to restore your system to a sensible state where you actually have control, you have to follow all these crazy steps:

sudo apt install resolvconf
sudo systemctl enable resolvconf.service
sudo systemctl start resolvconf.service
sudo nano /etc/resolvconf/resolv.conf/head

Add the following two name servers to the head:


Restart the service:

sudo systemctl restart resolvconf.service

To check your work:

cat /etc/resolv.conf | grep -v '#'

The above command does an invert match so it will display lines that do not have comments.

What a mess. Well done Ubuntu.

Share this article

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to Top