Security

DDoS protection basics for websites and servers

Understand what a DDoS attack is, the difference between network floods and application-layer attacks, and the practical steps that keep a hosted site or VPS online.

BeginnerAll hosting and VPS2 min read

A distributed denial-of-service (DDoS) attack tries to take a site offline by sending more traffic than it can handle, usually from thousands of infected devices at once. No single firewall rule stops every DDoS, but knowing the types helps you choose the right protection and react calmly.

Before you start

  • No setup is needed to read this guide. Some steps need access to Cloudflare, WHM or your VPS.
  • Background on firewall types: what is a firewall.

The three kinds of DDoS

TypeExampleWhere it is stopped
Volumetric (layer 3/4)UDP floods, DNS or NTP amplification, many Gbps of junkUpstream network filtering by the data centre or a scrubbing service
ProtocolSYN floods, fragmented packetsNetwork filtering, kernel SYN cookies, host firewall
Application (layer 7)Thousands of requests per second to a search or login pageWAF, rate limiting, caching, CAPTCHA

Volumetric attacks must be filtered before they reach your server, because a full network link cannot be fixed by a firewall on the server itself. Application attacks look like real visitors and are filtered by behaviour.

Signs you are under attack

  • The site slows down or returns 503/508 errors while normal visitor numbers have not changed.
  • Access logs show huge numbers of requests to one URL, often with odd user agents or from many countries.
  • On a VPS, CPU or bandwidth jumps suddenly; see monitoring for scans and floods.

Practical protection steps

  1. Put the site behind a proxy CDN such as Cloudflare, and keep your origin server IP private.
  2. Cache aggressively. Cached pages cost almost nothing to serve; on MdmHost use LiteSpeed Cache.
  3. Rate limit expensive URLs such as logins, search and checkout; see Cloudflare rate limiting.
  4. Challenge suspicious visitors. Server owners can enable LiteSpeed anti-DDoS reCAPTCHA or Imunify360 WebShield.
  5. Limit connections per IP on servers you manage, for example CSF CT_LIMIT and CONNLIMIT, or nftables limits.
  6. Close unused ports so floods against them are dropped early; see ports a cPanel server needs.

Tip: During an active layer 7 attack, Cloudflare's Under Attack Mode (Overview page) challenges every visitor for a while. Turn it off once the attack ends.

What to do during an attack

  • Hosting customers: open a ticket from Support with the domain, the time it started and any log lines you have. Our 24/7 team can see server-level traffic you cannot.
  • VPS owners: identify the top IPs with ss -ntu | awk '{print $6}' | cut -d: -f1 | sort | uniq -c | sort -nr | head and block clear offenders in your firewall.
  • Do not pay anyone who threatens a DDoS unless you pay; report it instead.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.