A reflected DNS flood is built from the same packets your own servers spend all day waiting for.
Many reflected floods can be filtered by their source port at almost no cost. Few networks have any reason to receive UDP from memcached, chargen or SSDP, so inbound UDP from 11211, 19 or 1900 can simply be dropped upstream.
DNS is the clearest exception. Every network on the internet resolves names, so UDP arriving from port 53 is something you need. The filter that stops a DNS amplification flood is aimed at traffic that looks exactly like your own lookups, and DNS amplification testing exists to find out whether it can tell the difference.
DNS amplification testing, defined
DNS amplification testing is authorised traffic shaped like reflected DNS answers, sent at your own addresses from addresses the tester holds, to find where a reflected DNS flood is stopped, how long it runs before that happens, and whether the filter that stops it leaves your own name resolution working.
That last clause is why it needs its own run. A test that measures only absorption can pass while the fix it validated would take down every outbound lookup in the building.
What other pages already cover
The attack itself, small forged queries turned into large answers aimed at a victim, is explained in DNS amplification, with the ratios in amplification factor and the reflector pool in open resolver. The generic port filter for reflected UDP, and the fragments it misses, are in UDP reflection and amplification.
DNS as the thing being attacked (authoritative floods, water torture, cache timing) belongs to DNS DDoS testing. Nothing about authorising or pacing a run changes for this vector, so the complete guide to DDoS testing applies as written, with the caps in testing without disrupting production.
What follows is the receiving side: who on your network expects a DNS answer, which filters separate those answers from a flood, and how to test that without sending a single forged packet.
At a glance: who on your network expects a DNS answer
| Host | Does it expect DNS answers? | Answers arrive from | Answers arrive at |
|---|---|---|---|
| Your own recursive resolvers | Yes, constantly | Authoritative servers anywhere on the internet | A random high port per query |
| Hosts pointed at an outside resolver | Yes | A few known resolver addresses | A random high port per query |
| Container platforms forwarding upstream | Yes | The configured upstream | A random high port per query |
| Your authoritative nameservers | No: they receive queries on 53, they do not send them | n/a | n/a |
| Public service addresses (web, API, VPN, game) | Usually no | n/a | n/a |
The last row is the one most filters are written for. The first three are the ones they break.
Why a port rule costs more for DNS
Answers come back to random ports
Since the cache-poisoning disclosures of 2008, resolvers send each query from a randomised source port, the practice written up in RFC 5452. Their legitimate answers therefore arrive at random high ports.
A reflected flood does too. The attacker writes the victim's address and any port it likes into the forged query, and the reflector answers there. So the destination port of a DNS answer tells you nothing about whether anyone asked for it.
A resolver's answers come from everywhere
A recursive resolver talks to the authoritative servers of every domain your users and systems touch. Its legitimate answers come from an open-ended set of addresses that changes by the hour.
No source allowlist covers that. The one property that separates a resolver's real answers from a reflected flood aimed at the same box is that the resolver asked: a query is outstanding with that transaction ID, from that port, to that server.
Service addresses usually expect none
A web front end, an API gateway or a VPN concentrator rarely issues DNS queries from its public service address. When outbound lookups go through an internal resolver or leave from a different NAT address, answers from port 53 to the service address are always unsolicited and can be dropped outright.
"Usually" carries weight there. Single-address servers, small sites and appliances that resolve their own update or licence hosts do receive DNS answers on the same address they serve from. The inventory in the table above decides which addresses are safe to filter, and it has to be written down before the test, not inferred during it.
Four filters and what each one breaks
Each of these appears in real runbooks. Each stops at least part of the flood in a test that only measures absorption, and each has a cost that such a test never sees.
Drop all UDP from port 53
The bluntest rule stops every packet that carries the port. Against fragmented answers that is only the first fragment, so it needs the fragment rule below to be complete. It also cuts every lookup made by anything behind it: outbound API calls, mail delivery, certificate status checks, package mirrors and the monitoring agent's own endpoint.
The damage is delayed by whatever the resolvers already had cached, so a short run can finish before anything visibly fails. The inside-out probe described below is what catches it.
Drop port 53 except toward the resolvers
This is the correct rule for service addresses and the common next step. It leaves the resolver addresses open by design, and a resolver address is a good target.
A flood aimed there passes the filter, saturates the box every other host depends on for names, and takes out resolution across the network without ever touching a service. Resolver addresses need their own treatment: a stateful rule that passes only answers to outstanding queries, or a rate and size limit sized from the resolver's real answer profile.
The exception list also drifts. A new host configured to use an outside resolver directly needs its own exception, and nobody adds it until its lookups fail.
A port rule without a fragment rule
An answer bigger than the path MTU travels as several IP fragments, and a port number appears in the first of them only. Why that defeats a port rule, and the companion rule for later fragments, are in the UDP reflection definition.
The DNS-specific part is what that companion rule costs your own resolvers. DNS Flag Day 2020 recommended an EDNS buffer of 1,232 bytes so that answers fit one packet on almost any path, and the major resolver implementations adopted it as their default. A resolver advertising 1,232 bytes receives larger answers truncated and retries them over TCP, so its legitimate UDP is almost never fragmented, and dropping non-initial fragments toward it costs nothing.
A resolver still advertising 4,096 bytes is different. It legitimately receives fragmented answers for DNSSEC-signed names and large TXT records, and the same fragment rule breaks exactly those lookups.
The same rule at the provider, without your exceptions
A reflected DNS flood is heavy in bits, so it usually fills the uplink before any device of yours can filter it. The rule that matters is the one upstream: a BGP FlowSpec entry, a scrubbing template, or the provider's emergency filter.
The provider does not know which of your addresses run resolvers. A generic "drop UDP from source port 53 to this prefix", requested at the height of an incident, cuts resolution for everything in the prefix. The exception list has to exist at the provider too, agreed before anyone needs it, and the test is how you find out whether it does.
Testing it without forging anything
A legitimate test never forges a source address and never sends a query to anyone else's resolver. Neither is needed: everything the receiving side has to decide about is in the answers themselves, and answers can be sent directly.
What the generator sends
UDP from source port 53, carrying payloads that parse as DNS answers, sized the way reflected answers arrive: mostly near 4,096 bytes, the EDNS buffer that forged queries commonly advertise, so most of them fragment. The packets leave from a pool of addresses the tester holds, and every packet carries one of those addresses as its source.
No third-party resolver, open or otherwise, takes part. The reflection step is the attacker's, and the test skips it by delivering the reflected product straight to the target.
Three targets, one at a time
Run against a service address that should expect no DNS answers. That run measures the plain case: where the flood stops and how fast.
Run against a resolver address. That run tests whatever separates real answers from unsolicited ones, which is where stateful rules and size limits earn or lose their place.
Run against an open UDP service port, such as QUIC on 443 or a VPN listener. The attacker chooses the destination port, so a reflected flood can land on a port that is meant to be open, and any rule written as "everything else is closed anyway" is tested here.
The inside-out probe
For the whole run, have your own resolvers and a sample of hosts look up a fixed list of names every few seconds, and record success and latency per name:
- a small, ordinary record;
- a DNSSEC-signed name with a large answer;
- a name whose answer exceeds the resolver's EDNS buffer, so it falls back to TCP;
- a name that cannot be in cache, so the resolver has to go out for it.
The flood measurements say whether the filter stopped the attack. The probe says what the filter cost. A filter that scores perfectly on the first and fails the large or uncached names on the second is the self-inflicted outage this post is about.
What a real-source run cannot judge
The test's sources are a few hundred tester addresses. A real flood comes from tens of thousands of resolvers, each contributing a trickle, so a per-resolver answer limit that trips early in the test may never trip in the incident. Work out what each reflector would send in a real flood of the same size and compare that with the limit.
The second gap is specific to DNS. The public resolvers your hosts use are open by design, so they can appear in a reflected flood, rate-limited by their operators but not absent. A rule that allowlists them by address cannot be exercised by a test whose packets come from the tester's own addresses, and it is assessed by reading the configuration instead. The report should list both as not measured. DDoS simulation goes through the other properties of real attack traffic that a test chooses not to copy.
Reading the result
| Reading | Where it comes from | What it tells you |
|---|---|---|
| Bits per second upstream and inside the edge | Provider and edge interface counters | Where the flood actually stopped |
| Filter hits, first fragments and later fragments separately | The filtering device or the provider's report | Whether the fragment rule is doing any work |
| Time from first packet to first filter hit | Generator timeline against filter counters | Your time to mitigation for this vector |
| Inside-out success and latency per name class | The probe | What the filter cost your own resolution |
| TCP fallback count on the resolvers | Resolver statistics | Whether size limits are pushing real answers onto TCP |
| Goodput on the service | Client-side measurement | What users felt |
How much a port rule can see
The fragment arithmetic can be done before the run. On a 1,500-byte path, each IPv4 fragment carries at most 1,480 bytes of the UDP datagram, and only the first one carries the UDP header.
A 4,096-byte answer arrives as three fragments, and 64% of its bytes on the wire are in the two that carry no port. A port-only rule facing a flood of those answers removes a little over a third of it. A test whose generator sends only unfragmented answers will never show that, because every packet it sends carries the port the rule is looking for.
The order things fail
Without an upstream rule, the uplink fills first: the layer of first failure is the circuit, and every filter behind it is measuring traffic that already did its damage. The on-premise post covers that diversion problem in general.
With an upstream rule in place, the next thing to watch is the resolver. It is the one host whose job is to receive DNS answers from anywhere, and a flood aimed at its address is the run most likely to find a gap.
The other direction: is your network a reflector?
The receiving side is half of it. The other half is whether your own servers would take part in someone else's flood, and the owner can check that from an outside vantage point with real addresses and ordinary queries.
Does any resolver of yours answer recursive queries for an address outside your network? How large an answer does your authoritative server return for a small query, and does it give minimal answers to ANY queries as RFC 8482 recommends? Is response rate limiting enabled? The reasoning behind those checks is in the dual-role section of DNS DDoS testing, and outbound source validation is covered under BCP 38.
FAQ
What is DNS amplification testing?
It is authorised traffic shaped like reflected DNS answers, sent at an organisation's own addresses, to measure where a reflected DNS flood is stopped, how long it reaches the target before that, and whether the filter that stops it leaves the organisation's own name resolution working.
Can you test DNS amplification protection without spoofed traffic?
Yes. Forged sources have no place in an authorised test, and the receiving side does not need them: its defences act on the answers, so the tester sends DNS-answer-shaped packets directly from its own addresses and skips the reflection step entirely. Per-source thresholds and any allowlist of public resolvers cannot be judged this way and are assessed by arithmetic and configuration review instead.
Why not just block all UDP from port 53?
Because your own systems need those packets. Resolvers, mail servers, outbound API calls and certificate checks all depend on DNS answers, and those arrive from port 53 at random high ports, exactly like a reflected flood. A blanket rule stops the attack and every lookup behind it.
Does a CDN protect against DNS amplification?
It absorbs floods aimed at its own addresses. It does nothing for addresses that are not behind it: the origin, office links, VPN concentrators and the resolvers themselves. If any of those is reachable directly, it is a target, which is the subject of origin IP exposure and CDN bypass.
What EDNS buffer size should a resolver advertise?
1,232 bytes is the value DNS Flag Day 2020 recommended and the common default today. It keeps answers inside one packet on almost any path, sends larger ones to TCP, and makes dropping inbound UDP fragments toward the resolver essentially free.
Whether anyone asked
Most reflected protocols can be filtered by what they are. DNS has to be filtered by whether anyone asked for it, because a reflected answer and a real one are the same protocol, the same port and often the same size.
That makes the durable output of this test a list, not a number: which addresses expect DNS answers, how each one tells its own answers from the rest, and whether that list is written into the rule at the provider. The absorption figure changes whenever the contract or the circuit does. The list changes whenever someone adds a host.
A DNS amplification test that ends with the flood stopped and the probe still resolving has tested both halves. One that ends with only the first has tested the easy one.
