It is possible that resolvconf is misconfigured. This is especially likely if you have been playing around with its configuration files without really understanding how resolvconf and NetworkManager work.
For background information, please read the resolvconf documentation and Stéphane Graber's blog post.
First you should know that both Ubuntu Desktop and Ubuntu Server by default have resolvconf installed and activated. Resolvconf provides a framework for dynamically updating the /etc/resolv.conf file in an orderly and reversible way.
Second you should know that Ubuntu Desktop by default has NetworkManager installed and activated. By default NetworkManager starts an instance of dnsmasq to serve as a local forwarding nameserver. This NetworkManager-controlled dnsmasq instance listens for queries at 127.0.1.1. When NetworkManager starts the dnsmasq instance it tells resolvconf to insert the address
127.0.1.1 into resolv.conf. As mentioned in another answer, if you configure NetworkManager not to start a local forwarding nameserver instance then it will not start a local forwarding nameserver and will not tell resolvconf to insert the address
127.0.1.1 into resolv.conf.
This default configuration works properly, so unless your situation is special you should restore the default configuration.
To restore the default configuration, see to it that
- /etc/resolvconf/resolv.conf.d/head contains only the resolvconf header text consisting of two lines starting with a
- /etc/resolvconf/resolv.conf.d/base is an empty file
- /etc/resolvconf/resolv.conf.d/tail is an empty file
- /etc/resolv.conf is a symbolic link with content
To achieve this, execute the following commands.
dpkg-reconfigure resolvconf # And answer `Yes` to agree to dynamic updates
echo '# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN' > head
rm -f base tail original
The original configuration of NetworkManager is to have
in /etc/NetworkManager/NetworkManager.conf. It is a reasonable choice to disable the NetworkManager-controlled local forwarding nameserver by commenting out the
After doing all this it is advisable to restart the machine in order to clear out stale nameserver information records.