views:

296

answers:

4
+1  Q: 

Windows hosts file

What's the difference between these lines:

::1             localhost

...and

127.0.0.1       localhost

in Windows hosts file?

Initially I had the line of the first kind in my hosts file and typing localhost in the browser led me to 127.0.0.1. Then I didn't use localhost prompt in the browser for some time, and when I needed to use it again it just didn't work. I changed the first line form the second one in my hosts file and it worked. Why could that happen?

+4  A: 

::1 is IPv6.

127.0.0.1 is IPv4.

Joseph
+1  A: 

::1 is IPv6

127.0.0.1 is IPv4

I guess you disabled IPv6 in between tests?

Colin Pickard
A: 

The former, "::1" is IPv6 compressed syntax for the localhost. It is equivalent to 127.0.0.1. Did you disable IPv6 support in your OS or network adapter? Maybe that's why it stopped working.

Chris W. Rea
A: 

I believe ::1 is the IPV6 notation of 127.0.0.1.

Brandon
XP supports IPv6. It has to be enabled.
Joseph
Ah, my mistake then. Sorry.
Brandon