So are there any ways to block facebook.com outside the facebook.com domain?

I need a souliton that's not "webbrowser related" - no Add-on, so e.g.: a Privoxy rule.
It would still not work on HTTPS sites, only on HTTP, ok, but I still need this rule, but I don't have a clue what it is. Does anybody has?

Thank you!

on a desktop PC/Fedora 15

So I don't want to block facebook.com. I just don't want that that e.g.: if there is a foo.org that has a

  • This question doesn't have nearly enough information to solve. You don't mention your os or browser, what your network situation is, whether you have access to a router or DNS configs, whether you are blocking for one for a user, a computer, a network, or what. Please edit the question and be a lot more specific or it is likely to get closed as unanswerable. – Caleb May 23 '11 at 12:11
  • Please join to this discussion unix.stackexchange.com/questions/24694/… (or continue it here) – jojo Jan 4 '12 at 9:33

Assuming you have access to your firewall, You can just block Facebook's prefixes. You can find out their ASN from traceroute:

$  traceroute -n -A www.facebook.com
14 [AS3356]  630.713 ms  633.180 ms [AS3356]  629.633 ms
15 [AS3356]  578.959 ms  580.703 ms  579.624 ms
16 [AS32934/AS10753]  577.604 ms  557.247 ms  636.807 ms
17 [AS32934]  633.454 ms [AS32934]  602.556 ms  603.583 ms
18 [AS32934]  634.461 ms [AS32934]  634.431 ms [AS32934]  702.079 ms
19 [AS32934/AS10753]  701.423 ms  700.644 ms  700.937 ms

Which you can verify with tools such as these

$ dig +short AS32934.asn.cymru.com TXT
"32934 | US | arin | 2004-08-24 | FACEBOOK - Facebook, Inc."

Then you'd get their prefixes using a lookup service

$ lynx --dump https://www.dan.me.uk/bgplookup?asn=32934 2>&1 | grep AS32934
   IPv4 Prefixes seen at AS32934:       [AS32934]
     2620:0:1c00::/40     [AS32934]      [AS32934]      [AS32934]      [AS32934]      [AS32934]      [AS32934]      [AS32934]      [AS32934]       [AS32934]       [AS32934]       [AS32934]

You can then feed the prefixes into your firewall.

Of course, If I am a determined user, I could use any of the free proxies out there rendering this whole post moot.


One time-honored way of blocking access to remote sites is by putting "fake" entries (usually in the hosts file.

In short, edit /etc/hosts and add entries like this:    facebook.com    apps.facebook.com

FMI on this trick, read this; for more ideas of blocking, read that.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.