Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

is there any way to temporarily block websites in Ubuntu 11.10?

For example let's say ... Facebook (or any other website) is just available from 8pm or just for five minutes within two hours or anything? :D

Thank you!

share|improve this question

3 Answers

up vote 4 down vote accepted

The tool I'd recommend is Get-Shit-Done. It edits your host file so that you cannot access blocked domains using any browser. However, it does not have a scheduler (although you could use cron for that).

Stay Focusd is Chrome Extension that does something similar.

I personally use a secondary profile in Chrome, with the Whitelist extension, so that it blocks all websites, other than absolutely necessary ones

share|improve this answer
Stay Focused is awesome! – Jonas Oct 25 '11 at 13:59

Open Terminal (ALT+F2).

Type sudo -i in the input field. Check the Run in terminal option. Finally click Run button.

Type your password if necessary and press enter. Then enter the following commands.

gedit /etc/hosts

You will get Gedit Text Editor window.

For example, we need to block Facebook add the following lines just after 127.0.0.1 localhost.

0.0.0.1 facebook.com    
0.0.0.1 www.facebook.com

By doing this, it will block the site in all browsers including Google Chrome, Chromium, Mozilla.

That's it. When you now open www.facebook.com or facebook.com, you cannot access it. To enable back Facebook, remove the lines we added from the file /etc/hosts.

Source - Subin's Blog

share|improve this answer

If you use Firefox, the LeechBlock add-on looks like it might do what you wish.

share|improve this answer
Thank your for replying! – Jonas Oct 25 '11 at 9:17
Does anyone accidentally knows a similar add-on for Chromium? – Jonas Oct 25 '11 at 9:18

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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