Last active
August 4, 2024 06:25
-
-
Save djaiss/85a0ada83e6bca68e41e to your computer and use it in GitHub Desktop.
Block Twitter/Facebook in your /etc/hosts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Block Facebook IPv4 | |
127.0.0.1 www.facebook.com | |
127.0.0.1 facebook.com | |
127.0.0.1 login.facebook.com | |
127.0.0.1 www.login.facebook.com | |
127.0.0.1 fbcdn.net | |
127.0.0.1 www.fbcdn.net | |
127.0.0.1 fbcdn.com | |
127.0.0.1 www.fbcdn.com | |
127.0.0.1 static.ak.fbcdn.net | |
127.0.0.1 static.ak.connect.facebook.com | |
127.0.0.1 connect.facebook.net | |
127.0.0.1 www.connect.facebook.net | |
0.0.0.0 meta.com | |
0.0.0.0 www.meta.com | |
# Block Twitter | |
127.0.0.1 www.twitter.com | |
127.0.0.1 twitter.com | |
127.0.0.1 apps.facebook.com | |
# Block Facebook IPv6 | |
fe80::1%lo0 facebook.com | |
fe80::1%lo0 login.facebook.com | |
fe80::1%lo0 www.login.facebook.com | |
fe80::1%lo0 fbcdn.net | |
fe80::1%lo0 www.fbcdn.net | |
fe80::1%lo0 fbcdn.com | |
fe80::1%lo0 www.fbcdn.com | |
fe80::1%lo0 static.ak.fbcdn.net | |
fe80::1%lo0 static.ak.connect.facebook.com | |
fe80::1%lo0 connect.facebook.net | |
fe80::1%lo0 www.connect.facebook.net | |
fe80::1%lo0 apps.facebook.com |
I was also having trouble with Twitter. How I fixed:
- Go to Twitter
- Open developer tools, go to the application tab
- Click on "clear site data"
After that, Twitter was not able to load anymore
In addition to that, I also added 0.0.0.0 api.twitter.com
If you are using Pi-Hole for blocking just Facebook, you can plug these into the admin web console as wildcard domains:
facebook.com
facebook.net
fbcdn.com
fbcdn.net
fbsbx.com
fbsbx.net
fburl.com
fb.me
fb.com
m.me
messenger.com
Pi-hole wildcard domains match on regex like: (\.|^)facebook\.com$
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I finally blocked Twitter with a Chrome app, but for some odd reason the blank page I get still has that stupid bird.