简体   繁体   中英

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?

::1 is IPv6.

127.0.0.1 is IPv4.

::1 is IPv6

127.0.0.1 is IPv4

I guess you disabled IPv6 in between tests?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM