Apple

blocking a website on a mac

I found an easy way to block a website :

1. open spotlight and search for Terminal

2. Open terminal

3. sudo su –    and type your password

4. From the root prompt type  vi /etc/hosts

5. At the end of the existing text, type 127.0.0.1 , a space and then the site you want blocked, like this

….
127.0.0.1 WWW.BLOCKEDSITE.COM
127.0.0.1 BLOCKEDSITE.COM

6 save the file by type  :wq!  – this saves the file

7. Clear the cache of the browser and try navigating to blocked site. 

8 . type exit on the terminal and then close it.

Any application that access the site will also be blocked.   If you want to remove the block, follow the same steps , and remove the lines you added above.