# Ubuntu – Why nslookup result always comes from server 127.0.0.1

12.04

I find quite confused that nslookup always get result from Server 127.0.0.1

Does it because Ubuntu uses a local DNS cache by dnsmasq? But I have closed it and flushed my dns cache, then nslookup a host that I have never visited, then the output is still 127.0.0.1.

That makes me quite confused. Can anyone explain this for me?
By the way, my DNS server is set to 8.8.8.8.

By default Ubuntu does indeed cache DNS entries with Dnsmasq. Dnsmasq does a lookup when a DNS entry is not in its cache, which is why you'll always see the localhost (127.0.0.1) IP address when doing a DNS lookup without specifying the nameserver.
This behaviour can be overridden by editing /etc/NetworkManager/NetworkManager.conf and changing dns=dnsmasq to #dns=dnsmasq, after which you'll need to restart the network-manager service (sudo service network-manager restart).