Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
    
Added Update1 and Related questions –  Gennady Vanin Novosibirsk Aug 21 '10 at 5:15
    
@vgv8: please don't add unnecessary (un)related links to your question. Readability of the question is severly impacted –  Sathya Aug 21 '10 at 14:49
    
@moderator, I cannot post any question in SU, MSU, SO, as well as edit my posts. Is it intentional? –  Gennady Vanin Novosibirsk Aug 21 '10 at 17:38
    
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 Novosibirsk Aug 21 '10 at 17:40
    
@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 [email protected] if it's really urgent. –  Tom Wijsman Aug 21 '10 at 19:03
show 1 more comment

migrated from stackoverflow.com Aug 21 '10 at 13:43

This question came from our site for professional and enthusiast programmers.

marked as duplicate by Sathya, Tom Wijsman, Diago Aug 21 '10 at 17:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
    
Thanks for try but see my Update1 in main question –  Gennady Vanin Novosibirsk Aug 21 '10 at 5:06
    
@vgv8 - see my update. Perhaps this will provide a better answer. –  Oded Aug 21 '10 at 5:25
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.