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 18.104.22.168
#whois 22.214.171.124 | grep CIDR
To prevent outgoing access to www.facebook.com
#iptables -I FORWARD -p tcp -d 126.96.36.199/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?