I know how to block websites in the host file and it works with others, but with YouTube i just can't get it to work. What am I missing? youtube.com www.youtube.com
  • well i want to block youtube and after applying these settings, running -flushcache and restarting youtube still isn't blocked – kay Jun 6 '16 at 12:31

Map loopback address to youtube.com or others except localhost may cause some problems.

So map any unreachable IPv6 address is more better such like:

200:2:253d:369e::    youtube.com

You may need to flush the cache by running

sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder

Also, the entries in the hosts file need to be DNS names, not URLs (meaning the last two lines are wrong).

  • did that, also restarted safari, still not working – kay Jun 6 '16 at 12:05

You need to restart the entire computer, not just Safari or flushing cache.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .