here how facebook ot twiiter could be blocked … alot of lies and disturbed mode
http://www.cyberciti.biz/tips/linux-iptables-examples.html
iptables -A OUTPUT -p tcp -d www.facebook.com -j DROP
iptables -A OUTPUT -p tcp -d facebook.com -j DROP
iptables -A OUTPUT -p tcp -d twitter.com -j DROP
iptables -A OUTPUT -p tcp -d www.twitter.com -j DROP
for flush of rules
iptables -F
EDIT
not always work 🙁
added some code
iptables -I FORWARD -m string --string 'facebook' --algo bm -j DROP
iptables -I INPUT -m string --string 'facebook' --algo bm -j DROP
iptables -I OUTPUT -m string --string 'facebook' --algo bm -j DROP
iptables -I FORWARD -m string --string 'twitter' --algo bm -j DROP
iptables -I INPUT -m string --string 'twitter' --algo bm -j DROP
iptables -I OUTPUT -m string --string 'twitter' --algo bm -j DROP