Skip to content
Wallet live · USDT TRC20 · USDT BEP20 · BTC · ETH · SOL · XMR Free SSL · Malware scan · Instant image 24/7 desk · @rexahost
RexaHostRexaHost

Guides

What to Do During a DDoS Attack: A Step-by-Step Runbook

· 6 min read

What to Do During a DDoS Attack: A Step-by-Step Runbook

A calm, practical runbook for the first hour of a DDoS attack: how to tell an attack from a traffic spike, what to send your host, which mitigations to apply and how to harden afterwards.

Key takeaways

  • Stay calm and confirm it is an attack, not a legitimate traffic spike or a broken update.
  • Identify the type: volumetric, protocol or application layer. Each needs a different response.
  • Contact your host early with the IP, start time, symptoms and logs.
  • Apply what you control: rate limits, caching, blocking abusive patterns and protecting your origin IP.
  • Afterwards, review and harden so the next attack has less impact.

A distributed denial-of-service (DDoS) attack floods a server or network with traffic from many sources, aiming to make it unavailable. If you run anything popular, from a game server to a store, you may face one eventually. The worst time to plan your response is during the attack. This runbook gives you a clear sequence to follow so you can act quickly and calmly.

Types of DDoS attacks

TypeTargetExamplesWho mitigates
VolumetricNetwork bandwidthUDP floods, amplification (DNS, NTP, memcached)Provider or upstream filter
ProtocolNetwork stack, firewalls, connection tablesSYN floods, fragmented packetsProvider filter, plus OS tuning
Application layer (L7)Your app, web server or databaseHTTP floods, expensive search or login requestsYou, with rate limits, caching and a WAF

Understanding the type tells you where to focus. You cannot out-bandwidth a large volumetric attack from inside your server, but you can do a lot against an application-layer flood.

Phase 1: Detect and confirm (first 5 minutes)

  1. Check monitoring alerts: which services are down or slow?
  2. Rule out other causes: a recent deployment, an expired certificate, a full disk or a legitimate surge (a viral post or marketing email). Check analytics for real visitors.
  3. Look at the server:
    • Bandwidth: nload, iftop or vnstat -l
    • Connections: ss -s and ss -tan state syn-recv | wc -l for SYN floods
    • Top requesting IPs: awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -rn | head
    • CPU and memory: top or htop
  4. Classify: saturated bandwidth points to volumetric; huge numbers of half-open connections to a SYN flood; many requests for the same expensive URL to an application attack.

If you cannot reach the server over SSH, use the provider's console to log in.

Phase 2: Communicate (minutes 5 to 15)

Contact your host

Send a concise message to support. RexaHost support is available 24/7 on Telegram @rexahost, by email at support@rexahost.com and via tickets. Include:

  • Your service ID and the affected IP address.
  • When the problem started (with time zone).
  • What you observe: bandwidth, packet rates, connection counts, top source IPs or request patterns.
  • Relevant log excerpts or graphs.
  • Which ports or services are legitimately in use, so filters do not block real traffic.

Inform your users

Post a short status update on a channel hosted elsewhere, such as social media or a status page on separate infrastructure. Users are more patient when they know you are working on it.

Phase 3: Mitigate what you control (minutes 15 to 60)

Against application-layer floods

  • Rate limit per IP at the web server. In Nginx, limit_req_zone and limit_req cap requests per second.
  • Cache aggressively. Serve static and cached pages so requests do not hit PHP or the database.
  • Protect expensive endpoints such as search, login, cart and API routes with stricter limits or a challenge.
  • Block clear patterns: a specific user agent, URL or query string used only by the attack.
  • Use fail2ban to automatically block IPs that exceed thresholds in your logs.

Against protocol attacks

  • Ensure SYN cookies are enabled: sysctl net.ipv4.tcp_syncookies should return 1.
  • Close every port you do not need. Fewer exposed services mean fewer targets.
  • Limit new connections per IP with firewall rules.

Against volumetric attacks

If the link itself is saturated, nothing you do on the server helps, because the traffic arrives before your firewall sees it. This is handled by the provider's network filter or an upstream mitigation service. Your job is to give the provider accurate information and keep legitimate ports documented.

Example: an Nginx rate limit

A simple per-IP limit stops a single source from overwhelming your application while leaving normal visitors unaffected:

# in the http block
limit_req_zone $binary_remote_addr zone=perip:10m rate=10r/s;

# in the server or location block
location / {
    limit_req zone=perip burst=20 nodelay;
}

# stricter for login
location = /wp-login.php {
    limit_req zone=perip burst=3;
}

Test changes with nginx -t before reloading. Start generous and tighten as you learn what normal traffic looks like; overly strict limits can block real users behind shared networks such as offices or mobile carriers.

What not to do

  • Do not panic-reboot repeatedly. It rarely helps and loses diagnostic information.
  • Do not change many things at once. Apply one mitigation, observe, then the next, so you know what worked.
  • Do not block huge IP ranges blindly. You may cut off real customers or your own monitoring.
  • Do not retaliate. Attacking back is illegal and often hits innocent, compromised machines.
  • Do not forget to remove emergency rules that hurt real users once the attack ends.

Protecting your origin IP

Many attacks target the server's IP address directly. If you use a reverse proxy or CDN in front of a website, make sure the origin IP is not leaked:

  • Do not publish DNS records that point directly at the origin (such as an old "direct" subdomain).
  • Send email through a separate service or server so mail headers do not reveal the web server IP.
  • Allow web traffic to the origin only from the proxy's IP ranges.
  • If the IP has already leaked, consider moving to a new IP after the attack and keeping it private.

Phase 4: Recover and review

  1. Confirm normal service from external monitoring, not just your own browser.
  2. Keep temporary rules in place for a while; attacks often return.
  3. Write an incident summary: timeline, attack type, what worked, what did not.
  4. Harden: permanent rate limits, better caching, closed ports, separate infrastructure for status updates.
  5. Consider capacity: a VDS with guaranteed resources and a 2.5 Gbps port, or a dedicated server, gives more headroom against application-layer load than a small VPS.

Prepare before an attack

  • Set up external monitoring with alerts; see uptime and SLAs explained.
  • Write down your support contacts and service IDs where you can find them without the server.
  • Document legitimate ports and normal traffic levels.
  • Pre-configure rate limiting and caching.
  • Keep backups so a worst-case rebuild is possible; see our backup strategy guide.
  • Run a short tabletop exercise with your team: "If the site goes down at 2 a.m., who does what?"

Extortion and reporting

Some attacks come with ransom demands. Security agencies generally advise not paying: it funds criminals, does not guarantee the attack stops and may mark you as a willing payer. Keep evidence such as messages, timestamps and logs, and report the extortion to law enforcement in your country.

A word on responsibility

Launching DDoS attacks is illegal in most countries, and using any RexaHost server to attack others leads to immediate suspension on every track, including privacy-focused locations. If your server is compromised and used in an attack, the abuse team will contact you; cooperating quickly and cleaning up the server is the fastest route back to normal service.

Quick reference card

StepAction
1Confirm it is an attack, not a deployment or legitimate spike
2Classify: volumetric, protocol or application
3Contact support with IP, time, symptoms and logs
4Post a status update on separate infrastructure
5Rate limit, cache, block patterns, close ports
6Protect the origin IP
7Recover, review and harden

Running a service that attracts attention? Choose a VPS, VDS or dedicated server with headroom, and keep this runbook where your team can find it.

Frequently asked questions

How do I know if I am under a DDoS attack?

Typical signs are a sudden surge of traffic or connections from many sources, saturated bandwidth, very high CPU from requests, and a slow or unreachable service, often without a matching rise in real users.

Should I contact my host during a DDoS attack?

Yes, early. Share the affected IP, the start time, the symptoms and any logs. The network team can see traffic patterns you cannot.

Can I stop a large DDoS attack myself?

Not a large volumetric one. Attacks that saturate your network link must be filtered upstream by your provider or a mitigation service. You can mitigate application-layer attacks with rate limiting and caching.

Does RexaHost have DDoS protection?

RexaHost places a DDoS filter in front of the network. No filter stops every attack, so pair it with good application practices and an incident plan.

Should I pay a DDoS extortion demand?

Security agencies generally advise against paying. Payment does not guarantee the attack stops and can make you a repeat target. Report extortion to the relevant authorities.

#ddos#ddos attack#ddos protection#incident response#runbook

Plans in this article

Servers mentioned here

Most popular

VPS Pro

Standard
$4.69 /mo
$10.42Save 55% billed monthly
  • 2 vCPU
  • 4 GB RAM
  • 120 GB NVMe
  • 5 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6

VDS Core

Standard
$25.99 /mo
$48.41Save 46% billed monthly
  • 4 vCPU
  • 8 GB RAM
  • 200 GB NVMe
  • 5 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6

Dedicated E3

Standard
$44.99 /mo
$71.10Save 37% billed monthly
  • 4c/8t
  • 16 GB RAM
  • 2×480 GB SSD
  • 10 TB traffic
  • Root access · dedicated IPv4
  • Ashburn · London · Amsterdam · Frankfurt +6

Keep reading

Related articles

Live Chat · offline