Free, independent guides since 2010

Hosting & domains

DDoS attacks and how to protect a small website

What a DDoS attack is, why small sites get hit too, and practical protection: CDNs and web application firewalls, rate limiting, bot management, static hosting and what to do during an attack.

<guide section="Hosting & domains" type="article" read="1 min"/>

A distributed denial-of-service (DDoS) attack uses thousands of devices – often hacked cameras, routers and servers – to send so much traffic to a website that it collapses. You might think only banks and governments get attacked. Unfortunately, small sites are targets too: competitors, extortionists, angry visitors or simply random bots.

Types of attacks

TypeWhat happens
Network floodsHuge amounts of traffic overwhelm the connection
Application attacksMany requests to heavy pages like search or login exhaust the server
Bot abuseScrapers and spam bots act like a slow-motion attack

Protection that works

  1. Put a CDN in front of your site – most include DDoS protection (see what is a CDN).
  2. Enable a web application firewall with rules against common attacks.
  3. Rate-limit login, search, forms and APIs.
  4. Cache aggressively so most requests never reach your server.
  5. Hide your origin server: only allow traffic from the CDN.
  6. Go static where possible – a static site behind a CDN barely notices most attacks.

During an attack

  • Turn on your CDN’s “under attack” or challenge mode if available.
  • Contact your host and CDN support.
  • Block abusive countries or networks temporarily if your audience is local.
  • Do not pay ransom demands; report extortion to the police.
  • Afterwards: check logs, update passwords and review what made the site vulnerable.

Frequently asked questions

Will my host protect me against DDoS?

Most hosts have network-level protection against large attacks, but application-level floods – many requests to a slow page – often get through. A CDN or firewall in front of your site adds protection.

Is a DDoS attack a data breach?

Not by itself: it makes your site unavailable rather than stealing data. It can however be used as a distraction during other attacks, so check your logs afterwards.