How can I block complete access of my computer to certain domains but be able to switch it on whenever I want to? That is, I want that by default whenever my browser or any other application hits a page of the form http://something.domain.com, or a page who is somehow connecting me to http://something.domain.com — that it blocks it and don't send anything without my explicit consent.
I know we can block something completely by using hosts, but the trouble is that I may need to check these domains once in a while, so I would have to keep removing and adding it to hosts. Which is ok if I can refresh it somehow, or have a script do it quickly for me.
Is there a simple way to do it?
I have the impression it can be done with iptables, but this is a subject I am not familiar with.
