I want to block all, but one or two websites. This question is therefore relatively close to, but different from the following
- Parental controls with different settings for different users (difference: Parental control is not really a good flashship.)
- How to block websites temporarily? (difference: This is on how to block a particular website. I want to block everything except the ones I need.)
I know that this can be done with leechblock (for FF) or something similar for other browsers. I think that is not a very clean solution, because it is browser-based. I know this was both possible and easy with Firestarter but that package is deprecated.
I am looking for something which is both easy (not manually editing hosts, but a script for instance) and systemwide. It can use the CLI.
I would love a relatively detailed answer rather than just links to other websites - screenshots would be most welcome.
You can block websites system-wide by adding entry to hosts file. It works same as in windows.
Here's how to do it :
Open terminal and type :
append the file with
Now whenever you'll visit facebook.com it will take you to localhost. FYI, it is not re-direct.
Worth reading: http://www.howtogeek.com/howto/27350/beginner-geek-how-to-edit-your-hosts-file/