Blocking Facebook


#1

Hi all
New to OpenWrt as well as Linux, but I am loving Linux (MXLinux is my main OS)
Anywayyyy
I would like to block facebook completely.
There is http facebook and https facebook.
I understand that there is a big difference.

That being said,
Do I go into Network --> Firewall --> Custom Rules ??
If so, what am I typing in there?
I really really really want to block any and all access to facebook on my network, even if it is through an android or an iOS app.


#2

I installed LuCI OpenWrt 18.06 branch


#3

Well, there's probably hundreds of IP addresses associated with Facebook content and services. Many are shared with other content providers, called CDNs (Content Distribution Networks) and you can't really block them without losing other services. Best you can probably do is find all the Facebook domains (many may not be facebook.com) and at least block local DNS for them.


#4

The only effective way to block by name other than DNS blocking is to use a proxy.


#5

To block Facebook via DNS, block the following domains:

facebook.com
facebook.net
facebook.co.in
facebook.co.uk
fbcdn.com
fbcdn.net
fbsbx.com
fb.me
fb.com

To block via IP, have a look at this new project: banIP: new project needs testers & feedback
There you can block via ASN number, e.g. the primary ASN for facebook is 32934 - that's all to effectively block facebook via IP.