1

I am following the next tutorial to block some distracting websites: http://masonsklut.com/how-to-block-websites-on-your-mac-using-terminal/

The problem is that the tutorial covers IPv4 configurations, not IPv6 configurations. Therefore, localhost won't be 127.0.0.1

I've read about it and localhost for IPv6 is ::1 but I can't make it work.

These are the lines I am using in my host file (Mac).

::1 www.facebook.com
::1 twitter.com
::1 www.linkedin.com
::1 www.youtube.com

After that change, I flush the cache but still don't work.

Alex
  • 131
  • 1
  • 3

2 Answers2

2

I've found the solution finally.

This is the code I am using in my host file.

0.0.0.0 www.youtube.com
::  www.youtube.com
0.0.0.0 www.facebook.com
::  www.facebook.com
0.0.0.0 www.instagram.com
::  www.instagram.com
0.0.0.0 www.linkedin.com
::  www.linkedin.com
0.0.0.0 twitter.com
::  twitter.com
Alex
  • 131
  • 1
  • 3
0

I believe you need to include your Zone ID at the end of the IP6 address.

If your Zone ID is 8 you need to add %8 to the end of your IP6 address eg:

::1%8 www.facebook.com ::1%8 twitter.com ::1%8 www.linkedin.com ::1%8 www.youtube.com

I'm not sure what the command to find your interface/Zone ID is on a Mac but on my Windows PC I've used the following command to work it out and seems to work well: netsh interface ipv6 show addresses

On OSX I think you can use your adapter name, look that up and try adding that to your IPV6 address, eg, if your adapters name is eth0:

::1%eth0 www.facebook.com

Jonathan
  • 1
  • 2