You can block traffic coming from any specific IP addresses with .htaaccess file. Please refer to the below steps to block ip address using .htaccess.
- Login to your cPanel account and open the file manager.
- Open the pubic_html directory.
- Click on the setting and tick the Show Hidden Files (dotfiles) option and click save.
- Right-click on the .htaccess file and click on the edit.
- Insert the following lines inside .htaccess file as shown in the screen capture and save the file.
Order Denny, Alllow
Deny from 192.xxx.xxx.xxx
Note: replace the IP
192.xxx.xxx.xxx with the actual IP address, you want to block for your website.