<div dir="ltr">I read the solutions and applied everyone one by one but could not make localhost not work. My localhost server is actually running on <a href="http://localhost:5000">http://localhost:5000</a> .<div><br></div><div><ul><li>Removed /etc/hosts<br></li><li>Set dns=none in /etc/NetworkManager/NetworkManager.conf<br></li><li>Set hosts : files in /etc/nsswitch.conf (i.e. deletd <span style="font-size:12.8px">mdns_minimal [NOTFOUND=return] dns )</span><br></li><li>Flush dns cache using sudo /etc/init.d/nscd restart<br></li><li>Restart network manager.</li></ul><div>The localhost is running and ping localhost is showing 127.0.0.1 . Any more changes that I can apply?</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 28, 2015 at 9:43 PM, Rashkae <span dir="ltr"><<a href="mailto:ubuntu@tigershaunt.com" target="_blank">ubuntu@tigershaunt.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 15-12-28 05:09 AM, Tom H wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Give "dig @<a href="http://8.8.8.8" rel="noreferrer" target="_blank">8.8.8.8</a> localhost." or "dig @<a href="http://208.67.222.222" rel="noreferrer" target="_blank">208.67.222.222</a> localhost." a try and let us know whether you get an answer; "localhost" is special. <br>
</blockquote>
<br></span>
NXDOMAIN, which is what I would expect.  When I said it would resolve by DNS, I meant the resolver library would query DNS if localhost is not in /hosts.  Whether or not DNS responds with 127.0.0.1 would then depend on configuration of the DNS server to which that query is made.<span class=""><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The OP,  AFAIU, set "<ip_address> localhost" in "/etc/hosts" where<br>
ip_address isn't "127.0.0.1" but localhost was still being resolved as<br>
"127.0.0.1" because the OP hadn't set "dns=none" in the NM<br>
configuration.<br>
<br>
</blockquote>
<br></span>
No, the IP tried commenting every line in /hosts, was surprised localhost was still resolving, and assumed, because of another problem they were having, that Network Manager dns caching was taking priority over /etc/hosts.<br>
<br>
My points are:<br>
<br>
1. dns cache server resolving localhost in the absense of an entry in hosts file is normal.  (while I haven't tested the dnsmasq software used by Network Manager, it is, indeed, the default configuration of Bind to do so.)<br>
<br>
2.  If hostnames in hosts file are indeed resolving to something else when NM dns caching is in play, *that* is an issue of resolve order, (or, I think, more likely, something done wrong in the hosts file, as not many would ever touch nsswitch).  In either way, the default config of Network Manager should not in any way bypass hosts file.  Name resolution by other programs has nothing to do with Network Manager config, other than the DNS servers used when the query gets to that point.<div class="HOEnZb"><div class="h5"><br>
<br>
<br>
<br>
<br>
-- <br>
ubuntu-users mailing list<br>
<a href="mailto:ubuntu-users@lists.ubuntu.com" target="_blank">ubuntu-users@lists.ubuntu.com</a><br>
Modify settings or unsubscribe at: <a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-users" rel="noreferrer" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Shashwat Kumar<br>Final year Undergraduate student<br>Department of Computer Science and Engineering<br>IIT Kharagpur<br><br><br><br><br></div></div>
</div>