The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Banning hostnames.

Discussion in 'General Discussion' started by jmweb, Mar 3, 2004.

  1. jmweb

    jmweb Well-Known Member

    Joined:
    Aug 8, 2003
    Messages:
    77
    Likes Received:
    0
    Trophy Points:
    6
    how do you ban hostnames via iptables? Ips are something else but hostnames, not sure how.
     
  2. BrightAdmin

    BrightAdmin Well-Known Member

    Joined:
    Feb 29, 2004
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    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
     

Share This Page