Why would 127.0.0.1 in resolv.conf cause problems in DNS resolution?
dns-search options to /etc/network/interfaces.
auto eth1 iface eth1 inet static address 188.8.131.52 netmask 255.255.255.0 gateway 184.108.40.206 dns-nameservers 220.127.116.11 18.104.22.168 dns-search m2osw.com
2: Remove all
dns- options from files in
/etc/resolvconf/resolv.conf.d/. That resolv.conf includes
nameserver options after
nameserver 127.0.0.1 indicates that such cruft is present. If /etc/resolvconf/resolv.conf.d/tail is a symbolic link, make it a symbolic link to
3: Downup eth1.
sudo ifdown eth1 sudo ifup eth1
4: Look in /etc/resolv.conf. Is
nameserver 127.0.0.1 still there and are replies to DNS queries still delayed? If so then figure out where the
nameserver 127.0.0.1 line is coming from. Something is registering the listen address 127.0.0.1 without starting a local nameserver at 127.0.0.1. (i) One possibility is the bind9 package. If you aren't running a local BIND nameserver then purge the bind9 package (
sudo apt-get purge bind9). If you are running a BIND nameserver that doesn't provide general Internet name service then edit /etc/default/bind9 and set
RESOLVCONF=no, then restart the nameserver. See: https://bugs.launchpad.net/ubuntu/+source/bind9/+bug/933723 (ii) Another possibility is that you have remnants of dnsmasq or similar package on the system. Purge that package. Also purge network-manager since you aren't using it.
5: Reboot and see if things have improved, then report back here.
Using a dns server with a loopback address (e.g. 127.0.0.1) causes problems:
All other dns server with a lower priority are ignored by
The priority of dns servers is defined by the network interfaces with which the dns-server is defined.
man 5 interface-order.
Luckily there is an environment variable to change this behaviour:
man 8 resolvconf
/etc/default/resolvconf and restart the
resolvconf service all other dns server will show up in