DDOS attacks are difficult to control, a firewall as a first step and must be a hardware firewall that blocks 99% of attacks but is relatively expensive and is not offered by every provider.
For cPanel, CSF (ConfigServer Firewall) is very good choice. It can prevent server from d/Dos attack, but as much as hardware firewall.
You need do the following setting to prevent DOS Attack.
1) Open the CSF configuration file
2) then, search for option called
and change this to
,now here 60 is the max no.of connections from an IP to your server ( choose this value according to your server usage )
3) Now search for option called
.This option is used to specify the port for which you want prevent DOS attack.E.g : if you want to prevent the DOS attack to apache and DNS – port 80 and port 53 , change
CT_PORTS = “”
CT_PORTS = “80,53″
4) Save the file and restarted the CSF firewall.