Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!


Discussion in 'Security' started by GoWilkes, May 9, 2017.

  1. GoWilkes

    GoWilkes Well-Known Member

    Sep 26, 2006
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Most of the sites on my server only target US traffic, but a few deal with international so I can't really block through the firewall. Currently, I have a MySQL table with a series of IP ranges listed, and I allow each user to access that table in their header and deny access to any IP within a found range, which saves a lot of server stress but it doesn't help prevent spam (unfortunately).

    I'm pasting below the IP ranges that are being blocked. I'm concerned about the list staying updated, though... I had one local internet provider that started using what used to be a foreign IP range, so now I worry that I need to access an up-to-date public database somewhere.

    So the first question is, can you guys recommend a way to block RIPE, APNIC, AFRINIC, and LACNIC IPs on a site level? And, if possible, on an email level?

    If not, what are your thoughts on permanently blocking the following IP ranges? If it's not a good idea, do you know of a public database I can use instead of gathering them locally?

    # Russia .ru
    # RIPE.NET (Europe, the Middle East and parts of Central Asia)
    # APNIC (Asian Pacific Network Information Center)
    # LACNIC (Latin American and Caribbean Network Information Center)
    # Other
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    You can use the "Blacklisted SMTP IP addresses" option under "Access Lists" in "WHM >> Exim Configuration Manager >> Basic Editor" if you'd like to block full IP ranges. As far as at the domain level, you'd need to utilize an .htaccess file to do this:

    How to Block an IP address range using the .htaccess file

    This third-party URL includes some links to public databases:

    How do I block a country using .htaccess

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice