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

AspectDetail
MechanismRandom subdomain floods
CostFull lookups per miss
DefenseRate limiting

How it works

  1. The attacker generates thousands of random subdomains: a1b2c3.yourdomain.com, x9y8z7.yourdomain.com...
  2. Queries flood your authoritative nameservers and upstream resolvers.
  3. Each query results in NXDOMAIN (the subdomain doesn’t exist).
  4. The flood exhausts nameserver resources and resolver negative caches.
  5. 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.

Last verified: 2026-10-28