The nuclear option for blocking Facebook and Google

I took the list of domains from the following pages:


And then I edited my computer’s /etc/hosts file to include the following lines.

This blocks my computer from contacting Google and Facebook, and now a lot of sites load way faster. It still allows Youtube, but you can un-comment those lines out too, if you like.

Put it on your computer too!

(To view the big block of text that you need to copy into your /etc/hosts, click the following button. It’s hidden by default because it’s BIG.)

Published by

The Grey Literature

This is the personal blog of Benjamin Gregory Carlisle PhD. Queer; Academic; Queer academic. "I'm the research fairy, here to make your academic problems disappear!"

One thought on “The nuclear option for blocking Facebook and Google”

  1. I also recommend following these instructions to set up a togglehosts function:

    If you use #elementaryOS and want to use the togglehost function and the cron job from this blog post:

    1. Put the togglehost function in ~/.bash_aliases
    2. Put the following modified line in $ crontab -e

    * * * * * if [ ! -e /etc/hosts ]; then export DISPLAY=:0.0 && /usr/bin/notify-send “Hosts file does not exist”; fi

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.