I need to block a particular website on my Mac (OSX 10.11.1, El Capitan).
I have already made the changes to /etc/hosts but the website is still not blocked when testing from Chrome. I think this has to do with it being an HTTPS connection.


Using sudo nano /etc/hosts, I have modified the /etc/hosts file to add the following lines: goodreads.com

I checked the changes with cat /etc/hosts. Then I flushed the DNS cache using sudo killall -HUP mDNSResponder and sudo dscacheutil -flushcache. I then try to access the page from within Chrome and it succeeds. I have also rebooted the machine, but the connection still succeeds.

It seems that this should work. I have searched extensively, and this approach is the most recommended. What am I missing?


Please use the following hosts file entries:

# Host Database
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##       localhost       goodreads.com www.goodreads.com www1.goodreads.com broadcasthost
::1             localhost
fe80::1%lo0     localhost

To properly block websites with the hosts file you also have to include aliases like www, ww1, www1, mail etc.

| improve this answer | |
  • Confirmed. When I added the www. to the domain name the website was blocked. Many thanks! – Hephaestus Jan 11 '16 at 6:51

You must log in to answer this question.

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