Why dig reports the dns server as 127.0.0.1 when I'm using a external DNS?

By default, NetworkManager uses Dnsmasq as a DNS resolver, if it's installed. Which is the default on Debian based systems, so Dnsmasq runs in a default configuration where it only resolves names based on the upstream servers specified by command line options (plus the contents of /etc/hosts). You have no /etc/dnsmasq.conf because that file is only present in the optional package dnsmasq.

To see whether your system is currently using Dnsmasq or Unbound for DNS queries, run netstat -ulnp | grep ":53 ".

In Ubuntu 12.04, NetworkManager doesn't play well with other DNS resolvers (see bug 959037 — Thomas Hood's summary pretty much covers it all). To keep running Unbound together with NetworkManager, your best bet is to tell NetworkManager not to run Dnsmasq (you don't need it in addition to Unbound, not unless you're using features of Dnsmasq that NetworkManager doesn't use). To do that:

  1. Edit /etc/NetworkManager/NetworkManager.conf to comment out the line containing dns=dnsmasq (add a # at the beginning of that line).
  2. Restart NetworkManager with service network-manager restart.

Tags:

Dns

Dnsmasq