Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 270
Alex Avatar asked Apr 01 '09 14:04

Alex


2 Answers

::1 is IPv6.

127.0.0.1 is IPv4.

like image 105
Joseph Avatar answered Jan 03 '23 18:01

Joseph


::1 is IPv6

127.0.0.1 is IPv4

I guess you disabled IPv6 in between tests?

like image 42
Colin Pickard Avatar answered Jan 03 '23 16:01

Colin Pickard