I guess this can also implemented through tcp wrappers
. Not very sure, but yes if this works it would be much easier.
There are two files basically.
You can put /etc/hosts.allow
ALL EXCEPT .ORKUT.COM : 192.168.1.
ALL EXCEPT .FACEBOOK.COM : 192.168.1.27
This will block orkut.com for everyone in network 192.168.1.X
and block facebook.com & orkut.com both for 192.168.1.27
Hope this helps. This should work.