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
  • 1
    Have you read this? http://superuser.com/questions/544789/why-cant-i-block-facebook-using-etc-hosts-on-mountain-lion-os-x – root Apr 22 '16 at 15:37
  • In regards to what @root it pointing out, which version of OS X are you using exactly? – Ƭᴇcʜιᴇ007 Apr 22 '16 at 15:39
  • All you have to do is point the domain to address not in use, this could be your own local IPv6 LAN address, and you would accomplish your goals. You do understand using method to block websites isn't effective right? – Ramhound Apr 22 '16 at 16:02
  • @Ƭᴇcʜιᴇ007 latest version: 10.11.4 – Alex Apr 22 '16 at 16:05
  • @root that solution didn't work for me. – Alex Apr 22 '16 at 16:08

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
  • Hey @Jonathan are you referring to this command? `networksetup -listallhardwareports` - I see my WiFi connection is over en0 - I am using `::1%en0 www.facebook.com` but that didn't work for me. – Alex Apr 23 '16 at 15:14
  • Hi Alex, I unfortuantely do not have an OSX system so am unable to test this myself but perhaps try the following as it might work with OSX: `fe80::1%lo0 www.facebook.com` OR `fe80::1%en0 www.facebook.com` – Jonathan Apr 24 '16 at 01:58