Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?

share|improve this question
up vote 4 down vote accepted

Yes, should be left. IPv6 is enabled, but IPv4 is still used.

share|improve this answer
So I should include the following in my hosts file? localhost ::1 localhost – filmoreha May 2 '12 at 13:13
Yes, you should keep both the ipv4 and ipv6 localhost addresses – Sirch May 2 '12 at 13:18

Leave the hosts file alone. Fiddle with it and you may break something. For example, if you remove the don't be too surprised if anything that uses localhost fails.

share|improve this answer
I was curious about and ::1 because I had never seen ::1 before and it (along with an IPv6 address) were the only things in my hosts file. Ended up cleaning things up a bit to include as well. – filmoreha May 7 '12 at 0:55
@filmoreha, I suspect that's a typo but there was no mention of You also need to consider that a hosted environment, even an unmanaged one, will have certain requirements for monitoring purposes, which is another reason to be cautious of modifying things like the hosts file. – John Gardeniers May 7 '12 at 2:23
Thanks, that was definitely a typo. I will keep what you said about monitoring in mind, hadn't thought about that! – filmoreha May 7 '12 at 2:49

Adding anything to /etc/hosts is not necessary, but really helps, so it will be pretty useful to add both (IPv4 and IPv6) records. After all, it is not expensive in any sense (10 seconds on each won't kill you day), but you'll know this part is done completely.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.