Is localhost host resolved to 127.0.0.1?

3

1

Possible Duplicate:
Why is “127.0.0.1 localhost” needed in HOSTS file ?

Is localhost host resolved to 127.0.0.1?

If "yes", then why does everything (IIS , ASP.NET, MS SQL Server, webapps, sharepoint, etc.) work on my WIndows XP Pro SP3 exactly the same if I use 127.0.0.222 (or any loopback IP 127.0..0.*) instead of 127.0.0.1?

Is localhost well-known Windows identifier?

Gennady Vanin Геннадий Ванин

Posted 2010-08-21T04:39:38.457

Reputation: 605

Question was closed 2010-08-21T17:20:55.653

Added Update1 and Related questions – Gennady Vanin Геннадий Ванин – 2010-08-21T05:15:16.190

@vgv8: please don't add unnecessary (un)related links to your question. Readability of the question is severly impacted – Sathyajith Bhat – 2010-08-21T14:49:30.900

@moderator, I cannot post any question in SU, MSU, SO, as well as edit my posts. Is it intentional? – Gennady Vanin Геннадий Ванин – 2010-08-21T17:38:52.010

Submitting question in SU, SO, MSU fails with: " Oops! Your question couldn't be submitted because:

users with less than 100 reputation can only post questions every 20 minutes; try again later." though I had not submitted any question for the last 24 hours – Gennady Vanin Геннадий Ванин – 2010-08-21T17:40:23.970

@vgv8: Moderator swill not be updated by commenting on your question, only Sathya will and he is not a moderator as he doesn't wear a diamond after his name. You could place your problem on the meta site so that a moderator sees it or contact team@superuser.com if it's really urgent.

– Tamara Wijsman – 2010-08-21T19:03:51.127

@TomWij. thanks but I have exactly the same issue on all sites (from which I am not banned), including MSU, i.e. posting there is also rejected with the same message. I wrote: "Submitting question in SU, SO, MSU fails with: " Oops!" They are the only sites from which I am not banned in trilogy (i.e. I am banned from MSO and MSF) – Gennady Vanin Геннадий Ванин – 2010-08-21T19:24:42.267

Answers

6

The Loopback device (aka Locahost) is mapped to the whole range of 127.0.0.0 to 127.255.255.255, which is why it 127.0.0.222 works:

The most commonly used IP address on the loopback device is 127.0.0.1 for IPv4, although any address in the range 127.0.0.0 to 127.255.255.255 is mapped to it.

Update

See this article on host name resolution (specific to 2003, but should apply to XP).

Possibilities:

  • Your DNS server is responding with localhost for any 127.* query (unlikely)
  • The entry is still cached (ipconfig /flushdns to clear it out)
  • You may have an lmhosts file that maps it

I have seen that the default networks file in windows contain loopback 127, which may be why this works.

It is also quite possible that the mapping loopback / localhost is built into the TCP/IP stack itself.

Oded

Posted 2010-08-21T04:39:38.457

Reputation: 1 130

Thanks for try but see my Update1 in main question – Gennady Vanin Геннадий Ванин – 2010-08-21T05:06:00.220

@vgv8 - see my update. Perhaps this will provide a better answer. – Oded – 2010-08-21T05:25:52.520