For automatic IP block cPanel provides special IP Deny Manager tool.
1. Navigate to IP Deny Manager menu in cPanel
2. Enter the IP address that should be blocked to the ‘IP Address’ field and click on Add button.It will be added to the list of blocked IPs.
You can always unblock IP by clicking Remove next to the IP address in question
To block/allow access from a specific country, you need to list all IP subnetworks that belong to this country.This can be quite challenging for manual configuration, so it is recommended to use special online tools that have access to such country-specific IP databases. Example of such an online resource is