how do you ban hostnames via iptables? Ips are something else but hostnames, not sure how.
how do you ban hostnames via iptables? Ips are something else but hostnames, not sure how.
Hi jmweb,
You can give domain name instead of ip , but it will be resolved when you add it (so it's exactly the same as adding the address it points to). the command is:
iptables -I INPUT -s domain name -j DROP
But if a single IP is shared by more than host then it is not possible with iptables.
Alternative for this is :
You can block any hostname with a deny from in .htaccess or the virtualhost directive if you wish.
Regards,
![]()
Bright