I want to block my Mac (running Snow Leopard) at work from accessing sites like Facebook and reddit.

there are browser extensions, but I'm worried about security – I get nervous allowing them to "access my data on all websites".

Is there a simple direct way to do it?

My main browser is Google Chrome.


You can edit your hosts file with this free and time saving utility:

Gas Mask

Gas Mask

You can have two profiles, for work and home. So you can switch with one click from one profile to another.

|improve this answer|||||

I use Firefox and block time wasting website using LeechBlock.

You put which website that you want to block, when you want to block, and the duration. The add-on will monitor how long you visit that site, and block if you are going beyond your limit. It is not accessing any website, just monitoring the URL bar for address.

Take a look at https://addons.mozilla.org/en-US/firefox/addon/leechblock/

|improve this answer|||||

Follow these steps:

  1. Open Applications/Utilities/Terminal and type the following (it will ask you to enter admin password because it is a system file)

    sudo nano /etc/hosts
  2. Type in the website you want to block in the following format: www.xxx.com
  3. Press CtrlX and press Y on your keyboard to save the modified buffer, and then press Enter.

  4. Save the file with ControlO and the return key to go back to Terminal.

  5. Clear your DNS cache by using following command

    sudo dscacheutil -flushcache

The websites will be blocked.

|improve this answer|||||
  • "Open 'Applications/Utilities/Terminal and type the following" … what should the OP type? – slhck Aug 19 '13 at 7:44
  • I cleared up your post, it contained a few formatting errors and wrong statements. nano etc/hosts won't work, you need a slash before /etc. Also, restarting the machine is not required. – slhck Aug 19 '13 at 7:54

Block it in /private/etc/hosts.

For example: www.facebook.com

You can edit this file by calling:

sudo /Applications/TextEdit.app/Contents/MacOS/TextEdit /private/etc/hosts
|improve this answer|||||
  • i can find /private/etc/host but i'm not quite sure what you mean me to add – Kirt Aug 19 '13 at 7:15
  • is the effect of this to redirect me to me local host instead of the external IP address if i try to access facebook? – Kirt Aug 19 '13 at 7:22
  • Exactly, it will try to reach localhost instead of facebook. – J0sha Aug 19 '13 at 7:36

You could just use http://www.persistence-app.com

It will block the sites you visit on all browsers

|improve this answer|||||

The ultimate answer to your question is StayFocusd, an app for Google Chrome. It's purposefully designed for your application and will allow you a short period every day on your "time wasting" websites (default 15 minutes I think).

You can configure it to only disable the sites during work hours, so you can continue using them after hours. There's other useful features as well.


|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.