Suppose I want to block Facebook permanently. To do this, I have followed following processes:
#host -t a www.facebook.com
www.facebook.com has address 188.8.131.52
#whois 184.108.40.206 | grep CIDR
To prevent outgoing access to www.facebook.com
#iptables -I FORWARD -p tcp -d 220.127.116.11/19 -j DROP
#iptables -I FORWARD -p tcp -d www.facebook.com -j DROP
Both Approaches work well. In approach 1, IP address may be changed so it will not block Facebook permanently. I don't know about approach 2 whether it will block Facebook permanently or not. If above approaches are not right way to block a domain permanently, how can I do it?