Pregunta

I understand domain names here will resolve to the IP shown on the left. But can someone elaborate on this subject and explain what each column does? From what I found, ::1 is IPv6 shorthand?

[root@stack]# cat /etc/hosts
127.0.0.1   localhost.localdomain localhost
::1         stack.corp.com        stack     localhost6.localdomain6   localhost6

Thanks!

¿Fue útil?

Solución

The first field is the IP address, the second the canonical host name, and any remaining fields are just aliases that will also resolve to the IP address in the first field.

::1 is, indeed, an IPv6 address, which is short for

0000:0000:0000:0000:0000:0000:0000:0001

(the :: stands in for as many zeros as possible while making the result a valid IPv6 address).

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top