How network manager is resolving localhost without /etc/hosts

Shashwat Kumar shashwatkmr.001 at
Sun Dec 20 20:57:48 UTC 2015

I tried to make a new mapping in /etc/hosts which didn't work. After
searching I found that network-manager does not use /etc/hosts but dnsmasq is
used as local dns resolver.

To confirm this design, I commented every line in /etc/hosts and flush
dnsmasq cache using

sudo /etc/init.d/nscd restart

and restarted network-manager

sudo service network-manager restart

But to my surprise ping localhost was still resolving to As per
my knowledge localhost mapping is only maintained in /etc/hosts. So how
localhost was still being resolved? Is there any information that I am

Thanks in advance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the ubuntu-users mailing list