Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Nermal

Moderator
Original poster
Staff member
Dec 7, 2002
20,982
4,546
New Zealand
My ISP now offers IPv6 and I've noticed that entries in /etc/hosts aren't respected any more. For example, I have "0.0.0.0 www.facebook.com" in there, yet I can still open the site in my browser (Safari).

ping www.facebook.com correctly gives an error, but ping6 www.facebook.com connects successfully. I've found a couple of comments saying that the file is ignored when using IPv6, but haven't been able to find any information on what to do about it.

Is there another file somewhere that works for IPv6? Or is there a setting I need to enable somewhere?
 

adrianlondon

macrumors 603
Nov 28, 2013
5,524
8,337
Switzerland
Does this help?

"
Nothing changes when the address is an IPv6 address instead of a legacy IPv4 address. The format is the same.
For example:

2001:db8:1::1 example.com www.example.com
2001:db8:2::1 mail.example.com
"
 
  • Like
Reactions: Nermal

Nermal

Moderator
Original poster
Staff member
Dec 7, 2002
20,982
4,546
New Zealand
Thanks :)

It looks like "If you have a dual-homed address (where a host listens to both IPv4 and IPv6), you will have to enter it twice, once for the IPv4 address and once for the IPv6 address" could be the trick. I'm away from my Mac at the moment but will give it a go when I can.

Edit: I can confirm that this works :)
 
Last edited:
  • Like
Reactions: adrianlondon
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.