Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've just installed Self Control for Ubuntu.

It looks like it just tweaks /etc/hosts and defines some rules in iptables.

Some sites aren't getting blocked, and I think it's because they're distributing hosting across a couple of servers. There's a system administrator way to say that, I'm sure, but I suspect I need to define wildcard rules.

So my first question is: can I write wild card rules for /etc/hosts and iptables (which?) to prevent access to anything at, hypothetically, * I don't need to do this inside of SelfControl.

I'd also like to fail more elegantly -- now the page just tries to load and doesn't. I'd like to redirect to a local page where I can offer myself little reminders about how this isn't actually where I want to spend my down time. Can I do that w/in the framework above? Redirect to a page on localhost?

(I am running a local web server, as I think anyone on Ubuntu is)

share|improve this question

No, you can't have wildcards in /etc/hosts.

One easy way to set this up where you can have wildcards is to install a local Squid proxy, and then use squid ACLs to ban access to *,, etc. You can make these ACLs active only for particular times of the week. Then you just need enough selfcontrol not to turn off your browser's proxy settings.

share|improve this answer

Some home based routers also offer fairly robust access restrictions as well which would not be tied to your OS but your MAC or IP address instead. I use the features in my router to block my child's access to specific sites as well as completely block access if there is a reason to, i.e., grades, restriction for other reasons. It uses rules which can be applied in several different manners including times of the day and days of the week.

just wanted to provide another alternative. :)

share|improve this answer
That would infuriate my family, I'm sure. But it is tempting. – Amanda May 16 '11 at 18:43

Your Answer


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.