9

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?

bdukes
  • 152,002
  • 23
  • 148
  • 175
Alex
  • 43,191
  • 44
  • 96
  • 127
  • Thanks. The box next to IPv6 is checked in Network Properties on my Vista. Can I somehow make sure that IPv6 is enabled for loopback? – Alex Apr 01 '09 at 15:14

4 Answers4

16

::1 is IPv6.

127.0.0.1 is IPv4.

Joseph
  • 1,873
  • 1
  • 15
  • 15
2

::1 is IPv6

127.0.0.1 is IPv4

I guess you disabled IPv6 in between tests?

Colin Pickard
  • 45,724
  • 13
  • 98
  • 148
1

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
  • 5,430
  • 41
  • 58
1

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

Brandon
  • 68,708
  • 30
  • 194
  • 223