LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   About hosts file ! (https://www.linuxquestions.org/questions/linux-newbie-8/about-hosts-file-761528/)

shipon_97 10-13-2009 12:24 AM

About hosts file !
 
Friends ,

In '/etc/hosts' file I got the below line ,

"::1 localhost6.localdomain6 localhost6"

Would anybody plz tell me , what is the meaning of this line ? And If I disable/delete , what problem can be happened ?

Waiting for kind reply ... ...

GrapefruiTgirl 10-13-2009 12:34 AM

I have never seen such a line in an /etc/hosts file, particularly the ::1 section, which should really be an IP address (though maybe that's shorthand for an IPv6 address of all-zeroes except for the last chunk, which is a one, and means localhost)

In fact, the more I think about it, it looks like the IPv6 equivalent of:
Code:

127.0.0.1 localhost
..which is the loopback address of all machines; except, I don't know how/where the "127" went to..

Typically the hosts file contains IP-to-name mappings, and optionally, alias(es) to those names, such as:

Code:

123.222.111.123    sillysite.com    silly
So, you see the IP address, followed by the domain name, followed by an optional alias (short name). The hosts file usually contains lines in this format. But with IPv6, items between colons, that are zeroes, can be omitted.

Sasha

EDIT: I edited the post after pondering the IPv6-ness of the line. You may want to Google up something like "IPv6 hosts file" and see what turns up.

shipon_97 10-13-2009 02:37 AM

about hosts file !
 
THX .. ..

lutusp 10-13-2009 03:14 AM

Quote:

Originally Posted by shipon_97 (Post 3717270)
Friends ,

In '/etc/hosts' file I got the below line ,

"::1 localhost6.localdomain6 localhost6"

Would anybody plz tell me , what is the meaning of this line ? And If I disable/delete , what problem can be happened ?

Waiting for kind reply ... ...

It is a way to maintain compatibility with the new IPV6 addressing scheme. It is to IPV6 what this is to IPV4:

Code:

127.0.0.1 localhost.localdomain    localhost
For now, the IPV6 line is a harmless addition to /etc/hosts. In the future, it may become essential in the same way that the IPV4 line is.


All times are GMT -5. The time now is 06:13 AM.