NXDOMAIN Attacks and Random Subdomain Attacks
NXDOMAIN attacks flood resolvers with queries for non-existent subdomains, exhaust resources, and can take an entire domain's DNS offline. Here's how they work and how to defend.
NXDOMAIN attack essentials
| Aspect | Detail |
|---|---|
| Mechanism | Random subdomain floods |
| Cost | Full lookups per miss |
| Defense | Rate limiting |
How it works
- The attacker generates thousands of random subdomains: a1b2c3.yourdomain.com, x9y8z7.yourdomain.com...
- Queries flood your authoritative nameservers and upstream resolvers.
- Each query results in NXDOMAIN (the subdomain doesn’t exist).
- The flood exhausts nameserver resources and resolver negative caches.
- In a targeted variant, random subdomains are chained to amplify DDoS traffic against the authoritative server.
Defenses
- Response rate limiting (RRL): throttles identical NXDOMAIN responses from your nameserver.
- Negative caching: the SOA minimum TTL controls how long NXDOMAIN answers are cached, reducing repeat queries.
- Anycast DNS: distributes query load across global nodes, absorbing the flood.
- Managed DNS: Cloudflare, Route 53, and other providers absorb these attacks as part of their service.
Frequently asked questions
Is my domain being attacked if I see random subdomain queries?+
Possibly: check your DNS provider’s query logs for volume spikes on non-existent names. The NXDOMAIN attack pattern is distinctive.
Does this affect my website visitors?+
It can: if the flood exhausts your nameservers, legitimate queries also fail, making your entire domain unreachable.
How is this different from a DDoS attack?+
NXDOMAIN attacks ARE a type of DDoS: they target the DNS layer specifically, using the protocol’s own response mechanism as the weapon.
What is negative caching?+
Resolvers caching NXDOMAIN answers so repeated queries for the same non-existent name don’t hit your server again. It’s a natural defense, controlled by the SOA minimum TTL.
Can I block specific query patterns?+
Yes: response policy zones (RPZ) or your DNS provider’s filtering rules can block queries matching known attack patterns.
Does DNSSEC help with NXDOMAIN attacks?+
Not directly: DNSSEC signs existing records. The attack queries names that don’t exist, so there’s nothing to verify. Negative caching and rate limiting are the defenses.
Related
Last verified: 2026-10-28