Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Block Twitter/Facebook in your /etc/hosts
# 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
# 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

Hi. Tried adding this on my android's host file. It still works perfectly. I even added the mobile URLs, but it never blocks it. Do you know any workaround?

byron21 commented Jan 17, 2018

To be more precise, we also need to add
127.0.0.1 m.facebook.com
and
fe80::1%lo0 m.facebook.com

How do you find these addresses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment