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.
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.
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: 18.104.22.168 Name: facebook.com Address: 22.214.171.124 Name: facebook.com Address: 126.96.36.199 Name: facebook.com Address: 188.8.131.52 Name: facebook.com Address: 184.108.40.206 </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 220.127.116.11
OrgName: Facebook, Inc. OrgID: THEFA-3 Address: 156 University Ave, 3rd floor City: Palo Alto StateProv: CA PostalCode: 94301 Country: US
NetRange: 18.104.22.168 - 22.214.171.124 CIDR: 126.96.36.199/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 188.8.131.52/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, 184.108.40.206/20 and 220.127.116.11/20