How to Block a Website in Safari

I received this question from a reader:

I run a business and I don’t want people going on youtube or Face Book, is there any way I can block these sites for cheap? I have a mac and Safari.

Do you work in a retail store? I see teenagers on Facebook at the local mall or Best Buy all the time. Hilariously enough the employees at these stores are either annoyed…..or on Facebook themselves!

Onto your question. There is a simple way of blocking websites on a Mac. Simply modify a file called “HOSTS”. This file allows you to add as many websites to it as you want. You can either block the websites outright or have them redirect to whatever site you want. The procedure is ridiculously easy.

Here’s how:

1) Click on Finder in your Dock.

2) Click on Go at the menu bar at the top of your screen.

3) In the Menu scroll down to Utilities. The Utilities folder will open. Double-click on the Terminal icon in the utilities folder.

4) A Terminal window will open. Type in the following:

sudo nano /etc/hosts

Press Enter.

5) You will be asked for a password. Type it in and then press Enter.

6) The HOSTS file will open in a special text editor. There will already be lines of text in the file. Add the two lines to the file like so:

127.0.0.1 www.google.ca

127.0.0.1 google.ca

Replace “google.ca” in both lines with your website. As you can see you will need to add your website twice. Once with “www” in front of it and once without.

7) Repeat for as many websites as you have.

8) Press Control-O (the letter not the number) on your keyboard and then press Enter to save the HOSTS file.

9) Press Control-X to close the text editor and return to the terminal interface.

10) Type in:

sudo dscacheutil -flushcache

Press Enter.

And you’re done! Now whenever someone tries to get to that website the computer will be unable to load it. If you want to unblock the website you can simply open the HOSTS file using the steps above and delete the two lines that you added.

If you have any questions ask them in the comments below.

 

Leave a comment

Your email address will not be published. Required fields are marked *