Skip to main content

API BlockIp::add_ip question

Comments

4 comments

  • cPanelLauren
    HI @swbrains It will add an .htaccess entry in the domain's .htaccess, just as would happen if you were to block an IP from the UI. This blocks it from accessing that account's domain's only. The resulting .htaccess entry if using their example would be the following: deny from 192.0.2.0
    I also found that a typo in the function will cause it to fail and opened a case for this. The function should be BlockIP
    not BlockIp
    0
  • swbrains
    Thanks. Is there any API function analogous to the Deny IP function in the firewall when you log into WHM?
    0
  • cPanelLauren
    Hi @swbrains Sort of, there is a way to block IP's via API for the whole server (WHM) but it's not going to utilize the firewall nor will it utilize an .htaccess block. The WHMAPI1 functions associated with cPHulk would do this for you WHM API 1 Sections - cPHulk - Developer Documentation - cPanel Documentation If you're using CSF and you wanted to block an IP address, while they don't have an API that I'm aware of the command is simply: csf -d
    0
  • swbrains
    Thanks. That's good info!
    0

Please sign in to leave a comment.