A real DDoS attack (putthing as much legitimate-looking traffic as possible through) won't be stopped by much. If it's a real DDoS, you'll need to consult with your hosting provider for options to mitigate the attack.
If it's low-level and the IPs aren't constantly changing and you have a dedicated or VPS, something like mod_cband in Apache HTTPd will probably help. You can rate-limit connections.