I have recently started using /etc/hosts to block distracting websites. For specific domains that works nicely, but is there any way to match a domain and all of its subdomains?

So, this blocks twitter and pinterest:   twitter.com   www.pinterest.com

But this doesn't block any tumblr page, and since users can create custom ones, I can't manually specify all of them:   tumblr.com

Using *.tumblr.com didn't work either. Is there some solution using the hosts file?

If not, I would also be fine with a solution involving iptables.


Your Answer

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

Browse other questions tagged or ask your own question.