What is a DDoS Attack?
A Distributed Denial of Service (DDoS) attack floods your server with more traffic than it can handle, making your website unavailable to legitimate visitors.
Types of DDoS Attacks
Volumetric Attacks
- Flood bandwidth with massive traffic
- UDP flood, DNS amplification
- Can exceed 1 Tbps
Protocol Attacks
- Exploit protocol weaknesses
- SYN flood, Ping of Death
- Exhaust server resources
Application Layer Attacks
- Target specific applications
- HTTP flood, slow POST
- Hardest to detect (looks like normal traffic)
Signs You Are Under Attack
- Website suddenly unreachable
- Extremely high bandwidth usage
- Server CPU/memory at 100%
- Unusual traffic patterns (single page, single country)
- Access logs showing thousands of requests per second
Protection Layers
1. CDN/Proxy Protection (Cloudflare, etc.)
- Absorbs volumetric attacks
- Geographic distribution
- Rate limiting
- Challenge suspicious visitors
2. Server-Level Protection
bash
# Rate limit with iptables
iptables -A INPUT -p tcp --dport 80 -m connlimit --connlimit-above 50 -j DROP
# Limit connections per IP with Nginx
limit_conn_zone $binary_remote_addr zone=addr:10m;
limit_conn addr 10;
# Rate limit requests
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;
limit_req zone=one burst=20;3. Application-Level Protection
- CAPTCHA for suspicious requests
- IP reputation checking
- Behavioral analysis
- Geographic blocking (if applicable)
Hosting Provider's Role
Good hosting providers offer:
- Network-level DDoS mitigation (BGP blackholing)
- Automatic detection and response
- Traffic scrubbing centers
- 24/7 NOC monitoring
During an Attack
- Don't panic — most attacks are short-lived
- Enable "Under Attack" mode on Cloudflare
- Contact your hosting provider
- Block attacking IPs if identifiable
- Document everything for post-incident analysis
- Don't pay ransom — it encourages more attacks
Prevention Checklist
- CDN/proxy configured (Cloudflare recommended)
- Rate limiting enabled on server
- Server resources monitored with alerts
- Hosting provider has DDoS mitigation
- Incident response plan documented
- Regular security updates applied
- Unnecessary services/ports closed
Conclusion
DDoS attacks are a reality of the modern internet. While no protection is 100% guaranteed, layered defenses dramatically reduce your risk. A CDN like Cloudflare combined with server-level rate limiting protects against the vast majority of attacks.