Planning 2027 Infrastructure & Cloud Costs? Free Webinar on October 20

How to Stop a DDoS Attack: 6 Strategies That Work

how to stop a DDoS attack - DDoS attack mitigation architecture - how to stop a DDoS attack with CDN filtering diagram
Cybersecurity

Originally published March 19, 2026. Updated September 2026 with Cloudflare's H1 2026 DDoS Threat Report data.

A DDoS attack floods your hosting infrastructure with traffic from thousands of sources at once. No single tool stops it, but six layered protections can keep your website or application available when the flood arrives.

A DDoS (Distributed Denial of Service) attack floods hosting infrastructure with traffic from thousands of sources within a short period of time, making a website or application unavailable to legitimate users. Motivations vary. Some attackers want to exploit a vulnerability or disrupt a service, while others attempt to extort organizations or cause downtime that damages revenue and customer trust.

The attacks are also getting bigger and shorter. In the first half of 2026, Cloudflare mitigated 935 network-layer attacks exceeding one terabit per second, and most attacks now finish in under ten minutes. That combination means human reaction time is rarely fast enough on its own, and the protections have to be in place before the attack starts.

In this blog, we cover how to stop a DDoS attack, what causes these attacks, six common mitigation strategies, what to do while an attack is underway, and answers to frequently asked questions.

How to Stop a DDoS Attack

Stopping or mitigating a DDoS attack typically requires a layered defense strategy. No single tool can completely prevent these attacks, but combining multiple protections, such as CDN filtering, scalable cloud infrastructure, hardened security configurations, and continuous monitoring, can significantly reduce risk.

Diagram of what a DDoS attack is: many compromised sources flooding a single target with traffic
A DDoS attack overwhelms a target with traffic from thousands of sources at once.

Below are 6 commonly used strategies organizations rely on to stop or mitigate DDoS attacks, starting with one of the most widely deployed defenses.

Why Organizations Need to Know How to Stop a DDoS Attack

DDoS attacks are designed to overwhelm infrastructure by generating artificial traffic spikes that exceed normal operating capacity. Instead of attempting to breach a system directly, attackers attempt to exhaust resources such as:

  • Compute (or Central Processing Units, "CPUs")
  • Memory
  • Bandwidth
  • Connection limits

Once those limits are reached, hosting resources can become unavailable and legitimate users can no longer access the system. Modern attacks can generate substantial volumes of traffic, sometimes exceeding the capacity of traditional hosting environments.

DDoS attacks are also increasing in frequency and scale. Industry reports indicate that millions of attacks occur globally each year, with many targeting small and mid-sized organizations whose infrastructure may not be designed for sudden traffic floods.

Cloudflare's year-end report for 2025 counted 47.1 million DDoS attacks mitigated across the year, more than double the prior year, and included the largest publicly disclosed attack on record at 31.4 terabits per second, which lasted just 35 seconds (Cloudflare 2025 Q4 DDoS Threat Report).

Chart showing DDoS attacks increasing by year and type
DDoS attack volume has grown sharply year over year.

Because of this increase in attack volume, organizations increasingly rely on secure, cloud-based infrastructure, edge filtering, and proactive monitoring to maintain availability during traffic floods.

What Changed in 2026: Bigger Attacks, Shorter Windows

The trend has continued into 2026, and the shape of the attacks has shifted. According to Cloudflare's H1 2026 DDoS Threat Report:

  • Hyper-volumetric attacks surged. Cloudflare mitigated 935 network-layer attacks exceeding 1 Tbps in the first half of 2026, with 805 of those in the second quarter alone, a 519% quarter-over-quarter increase.
  • Attack vectors shifted toward reflection and amplification. DNS-based attacks accounted for 34.3% of network-layer activity, and DNS floods alone climbed from 25.7% to 40% of network-layer attacks quarter over quarter.
  • Most attacks are short. 90.6% of network-layer attacks lasted no more than 10 minutes, and the largest attacks on record finished in under a minute.
  • Most attacks are still small. 96.6% of network-layer attacks stayed under 500 Mbps, which is enough to take down an unprotected small-business server but well within what an edge platform absorbs automatically.

The practical takeaway is that a burst attack can start and finish before anyone reads the alert. Protection that depends on a person noticing and reacting will often arrive after the damage is done. The strategies below are most effective when they are configured in advance and respond automatically.

6 Ways to Stop a DDoS Attack

1. Use a CDN With Built-In DDoS Protection

One of the most effective ways to stop a DDoS attack is by placing infrastructure behind a Content Delivery Network (CDN). A CDN distributes traffic across a global network of servers and acts as a buffer between users and your origin infrastructure.

Benefits include:

  • Filtering malicious traffic before it reaches your servers.
  • Absorbing large traffic spikes.
  • Distributing requests geographically.
  • Caching content to reduce server load.

Edge security platforms can filter, rate-limit, or absorb large volumes of traffic before it reaches your cloud infrastructure. Because these platforms respond automatically, they are also the layer best suited to the short burst attacks that now make up most of the volume. While a CDN handles traffic at the edge, your hosting environment also plays a critical role in surviving an attack.

2. Move Public-Facing Systems to Scalable Cloud Infrastructure

Public-facing systems are frequent targets during DDoS attacks. These systems are designed to accept connections from the internet, which makes them the most visible and accessible entry points for attackers.

Common public-facing systems include:

  • Websites
  • APIs
  • Login portals
  • E-commerce platforms

During a DDoS attack, these systems may experience a sudden flood of traffic that can overwhelm infrastructure resources. This can lead to slow response times, degraded performance, or service interruptions for legitimate users.

Hosting public-facing systems in scalable cloud environments can improve resiliency during these events. In many environments, organizations use hybrid cloud architecture, which combines private cloud infrastructure with public cloud capacity. This allows infrastructure to expand when traffic spikes occur.

This architecture can help organizations:

  • Distribute traffic across multiple systems.
  • Add compute resources temporarily during traffic surges.
  • Reduce the risk of single-server failures taking applications offline.

Scalable infrastructure does not eliminate DDoS attacks, but it can significantly improve an environment's ability to remain available during large traffic floods. These types of events are often referred to as hyper-volumetric DDoS attacks, and they are now common enough that Cloudflare counted more than 900 of them in six months.

Chart of hyper-volumetric network-layer DDoS attacks increasing over time
Hyper-volumetric attacks are large enough to overwhelm many traditional hosting environments.

Organizations evaluating their infrastructure often discover that improving resiliency requires both scalable architecture and ongoing operational oversight.

Even with cloud infrastructure in place, your network's first line of defense still depends heavily on how your firewalls are configured.

3. Configure Firewalls to Block Common DDoS Attacks

Firewalls play an important role in detecting and stopping certain types of DDoS attacks. For example, SYN flood attacks exploit the TCP connection handshake by sending connection requests without completing them.

Proper firewall configuration can help mitigate these attacks by:

  • Limiting incomplete connections.
  • Enforcing rate limits.
  • Filtering suspicious IP behavior.
  • Blocking abnormal traffic patterns.

While firewalls alone cannot stop every DDoS attack, they remain an important layer in a broader defense strategy. Firewall configuration can vary significantly depending on your infrastructure, traffic patterns, and security requirements. Organizations often benefit from having experienced engineers review firewall rules and network architecture to ensure protections are properly configured.

Beyond how traffic is filtered, the underlying configuration of your web servers also affects how well they hold up under pressure.

4. Harden Web Server Configurations

Web servers can be configured to handle abnormal traffic patterns more effectively. Common hardening practices include:

  • Limiting simultaneous connections.
  • Adjusting timeout values.
  • Optimizing request handling.
  • Keeping systems fully patched.

These adjustments reduce the likelihood that attackers can exhaust server resources during high-volume traffic events. Hardening individual servers is an important step, but protecting infrastructure as a whole also requires thoughtful network architecture.

5. Separate Critical Systems From Public Infrastructure

Another strategy for mitigating DDoS attacks is isolating critical applications from public-facing services. For example, organizations often place internal systems such as administrative tools, databases, and authentication services on separate networks or subnets. If public infrastructure experiences a traffic flood, these internal systems remain protected.

A well-configured cloud architecture makes this separation easier by allowing organizations to segment workloads across private and public environments. Even with strong separation in place, attacks can still catch teams off guard without the right visibility into what's happening across the environment.

6. Monitor Traffic for Early Signs of an Attack

Early detection can significantly reduce the impact of a DDoS attack. Organizations should monitor for signs such as:

  • Sudden spikes in traffic.
  • Unusual request patterns.
  • Abnormal CPU or bandwidth usage.
  • Unexplained performance slowdowns.

Continuous monitoring tools, combined with experienced engineers reviewing system behavior, help identify abnormal traffic patterns before they escalate into outages. Monitoring also matters after a short attack ends, because a burst that lasted eight minutes can still leave connection tables full, caches cold, or an application in a degraded state that needs attention.

Knowing the warning signs is valuable, but organizations also need a clear plan for what to do once an attack is already underway.

How to Stop a DDoS Attack (Quick Summary)

In a quick summary, these are the 6 strategies to stop or mitigate DDoS attacks:

  1. Using CDN-based traffic filtering.
  2. Deploying scalable cloud infrastructure.
  3. Configuring firewalls to limit malicious traffic.
  4. Hardening web server configurations.
  5. Separating critical systems from public-facing infrastructure.
  6. Monitoring traffic for early attack signals.

Prefer a quick walkthrough? Watch our video overview below.

WATCH: How to Stop a DDoS Attack (Video Overview)

What to Do During a DDoS Attack

Even well-protected systems may occasionally experience attack attempts. When this happens, the focus shifts to mitigation and recovery. Typical response steps include:

  1. Confirm it's an attack, not a traffic spike. Compare current traffic against your baselines. Sudden bandwidth or packet-rate jumps, connection table growth, and a rise in 4xx and 5xx errors alongside latency are the usual signs.
  2. Analyze incoming traffic. Identify suspicious traffic patterns or abnormal request behavior.
  3. Apply filtering rules. Block malicious traffic through firewalls or edge protection platforms. If your upstream links are saturated, internal tuning will not help; escalate to your CDN, ISP, or hosting provider immediately.
  4. Scale infrastructure. Increase infrastructure capacity temporarily to absorb traffic spikes.
  5. Monitor system stability. Continue monitoring systems until traffic patterns return to normal.

After the incident, teams should review system logs and performance metrics to strengthen defenses for future events. Capture what the attack looked like, what failed first, and how long mitigation took, so the next response is faster.

Responding effectively in the moment is critical, but the infrastructure underneath your response plan determines how much damage an attack can actually do.

Why Scalable Infrastructure Helps Stop DDoS Attacks

Many successful attacks occur because infrastructure has fixed capacity limits. When those limits are exceeded, the system becomes unavailable.

Diagram of a firewall filtering traffic in front of scalable cloud infrastructure
Scalable infrastructure gives an environment room to absorb a surge rather than fail at a fixed limit.

Scalable infrastructure reduces this risk by allowing environments to expand temporarily during traffic surges, making it one of the most practical long-term strategies for mitigating DDoS attacks.

Scalable cloud architectures can:

  • Distribute traffic across multiple systems.
  • Add compute resources temporarily during traffic surges.
  • Reduce the risk of single-server failures.

While scalability alone does not eliminate attacks, it improves resiliency during large traffic events. That resiliency is further strengthened when experienced engineers are actively overseeing the environment.

Proven at Scale: What We Learned Protecting MegaMillions

Most guidance on surviving a traffic flood is theoretical. DataYard has lived it, just not from an attacker. DataYard built, maintains, and operates the network and server infrastructure behind the MegaMillions lottery. When the jackpot hit $1.602 billion, the highest in lottery history, over 4.26 million visitors hit the MegaMillions website in the ten minutes after the drawing.

~10,000 Visitors per Second at Peak
4.26M+ Visitors in 10 Minutes
47 State Audience
99.999% Uptime Guarantee

A legitimate traffic surge of that size behaves a lot like a hyper-volumetric DDoS event: a massive, sudden spike in concurrent requests that would take down infrastructure built for normal-day traffic. The same architecture that kept MegaMillions online that night maps directly onto the strategies above:

  • Flexible server design built to host applications at scale precisely when it's needed most, not sized for an average day.
  • Geographically diverse infrastructure for redundancy, so no single location is a single point of failure.
  • A content delivery network and front-end cache to distribute data fast and efficiently, absorbing load before it reaches origin servers.
  • Next-generation firewalls protecting the infrastructure against malicious traffic, whether it's an attacker or an unexpected legitimate surge.

Whether the flood is a coordinated attack or a billion-dollar jackpot, the underlying engineering problem is the same: can your infrastructure absorb a surge without falling over. If we can do that on one of the biggest nights in lottery history, it's worth asking what that same architecture could do for your business. See the full MegaMillions case study for more detail.

Why Infrastructure Architecture Matters

Stopping a DDoS attack is rarely about deploying a single tool. Each of the 6 strategies above works best as part of a coordinated defense, not in isolation. Effective protection usually combines:

  • Edge traffic filtering.
  • Scalable cloud infrastructure.
  • Properly configured firewalls.
  • Hardened server configurations.
  • Real-time monitoring.

Organizations operating managed cloud environments benefit from continuous oversight by engineers who can detect unusual traffic patterns and respond quickly when conditions change. This combination of architecture, automation, and engineering oversight helps critical applications remain available during unexpected traffic events.

For a broader look at how DDoS protection fits alongside patching, access control, and recovery planning, see Layered Security: Why Patching Alone Is Not Enough.

Frequently Asked Questions

What Is the Fastest Way to Stop a DDoS Attack?

The fastest way to mitigate a DDoS attack is by filtering traffic through a CDN or edge security platform that can block malicious requests before they reach your servers. Because most attacks now last less than ten minutes, that filtering needs to be automated and already in place; a response that starts after the alert will often arrive after the attack has ended.

Can a Firewall Stop a DDoS Attack?

Firewalls can help mitigate certain attacks, such as SYN floods, but most DDoS attacks require multiple layers of defense, including traffic filtering and scalable infrastructure. A firewall also cannot help once the internet connection in front of it is saturated.

Can Cloud Infrastructure Prevent DDoS Attacks?

Cloud infrastructure cannot prevent attacks entirely, but it can absorb larger volumes of traffic and reduce the risk of service outages.

How Big Are DDoS Attacks Now?

Both extremes are growing. Cloudflare mitigated 935 attacks exceeding 1 Tbps in the first half of 2026, and the largest on record reached 31.4 Tbps. At the same time, 96.6% of network-layer attacks stayed under 500 Mbps. Small attacks are still large enough to take down an unprotected server, which is why edge filtering matters for organizations of every size.

Why Do Attackers Use DDoS Attacks?

DDoS attacks are often used to disrupt services, extort organizations, or distract security teams during other cyberattacks.

How Long Does a DDoS Attack Last?

DDoS attacks can last anywhere from a few seconds to several days, depending on the attacker's resources and goals. In the first half of 2026, 90.6% of network-layer attacks lasted no more than 10 minutes. Organizations with scalable infrastructure and active monitoring are better positioned to recover quickly regardless of duration.

What Is the Difference Between a DoS and a DDoS Attack?

A DoS (Denial of Service) attack originates from a single source, while a DDoS (Distributed Denial of Service) attack uses a distributed network of compromised systems called a botnet to flood a target simultaneously. DDoS attacks are significantly harder to stop because the traffic comes from thousands of different IP addresses.

Related pages: Cloud Management | Cybersecurity | Cloud Hosting | MegaMillions Case Study

Check out our other blogs