Alex
Alex

Reputation: 44709

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?

Upvotes: 9

Views: 7032

Answers (4)

Brandon
Brandon

Reputation: 69953

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

Upvotes: 1

Chris W. Rea
Chris W. Rea

Reputation: 5501

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.

Upvotes: 1

Colin Pickard
Colin Pickard

Reputation: 46633

::1 is IPv6

127.0.0.1 is IPv4

I guess you disabled IPv6 in between tests?

Upvotes: 2

Joseph
Joseph

Reputation: 1849

::1 is IPv6.

127.0.0.1 is IPv4.

Upvotes: 16

Related Questions