User Tools

Site Tools


tip

How-to block access to Facebook and Myspace

Question

I would like to know if there a way to block access to Facebook and Myspace as well as instant messaging. I tried to block myspace.com before and it only blocked it that one way leaving countless other ways to access it. Same with Facebook. Others like meebo.com and koolim.com are much of a pest as well.

Answer

I suspect the problem is that you can't block encrypted (https) connections by domain name. The connection is encrypted so you can't tell whether you're connecting to a given site.

Solution

S. Try doing an nslookup to determine the ip(s) of the sites you want to block. For example, if I run: <shell> $nslookup facebook.com </shell> I get: <shell> Non-authoritative answer: Name: facebook.com Address: 69.63.181.11 Name: facebook.com Address: 69.63.181.12 Name: facebook.com Address: 69.63.184.142 Name: facebook.com Address: 69.63.187.17 Name: facebook.com Address: 69.63.187.19 </shell> You could just block those ips, but big sites like facebook control a large block of ip addresses, and this could change. Here's a trick you can use to address that. Do a whois on one of the above ip addresses, and it will often tell you what the exact range is. <shell> $whois 69.63.181.11

OrgName: Facebook, Inc. OrgID: THEFA-3 Address: 156 University Ave, 3rd floor City: Palo Alto StateProv: CA PostalCode: 94301 Country: US

NetRange: 69.63.176.0 - 69.63.191.255 CIDR: 69.63.176.0/20 OriginAS: AS32934 … </shell> I just included the top portion of the whois result since that's the important part. It tells you that Facebook owns the 69.63.176.0/20 subnet. Block that, and you block facebook. Problem solved!

You can use the same tactic to lookup myspace.com as well. Actually, I'll save you some time: there are two subnets you should block for myspace, 16.178.32.0/20 and 63.135.80.0/20

tip.txt · Last modified: 2013/05/21 16:04 by eric