What is a DNS attack?

A DNS attack either targets the name system to break or redirect a domain, or abuses DNS as a tool to attack someone else or move data unseen.

Why is DNS such a common target?

Because everything depends on it and much of it runs over UDP. If a domain's name servers stop answering, every service on that domain disappears, however healthy the servers behind it. UDP has no handshake, so a forged source address is easy, and small questions can produce large answers. Those two facts make DNS both a target and a weapon.

What are the main types of DNS attack?

AttackWhat happensMain defence
Amplification and reflectionSmall spoofed queries to open resolvers trigger large replies aimed at a victimClose open resolvers, response rate limiting, network filtering
Random subdomain floodMillions of queries for nonexistent names exhaust authoritative serversAnycast capacity, rate limits, aggressive negative caching
Domain hijackingRegistrar account taken over, name servers changedTwo-factor login, registry lock, change alerts
Cache poisoningForged answers stored by a resolverValidate DNSSEC, randomise source ports
TunnellingData hidden in queries and replies to bypass controlsMonitor query lengths and volumes, restrict resolvers
Dangling recordsA CNAME points to a released resource someone else can claimRemove records when services are retired

How does DNS amplification work?

An attacker sends small queries with the victim's address as the source to many open resolvers, asking for a large record set. Each resolver sends its large answer to the victim, which never asked. A 60-byte query can yield a reply of several kilobytes, an amplification factor of fifty or more, so a modest botnet produces a flood of hundreds of gigabits. The traffic arrives from legitimate resolvers, which makes it hard to block by source.

How do I make sure my server is not part of the problem?

Never run an open resolver. If you run Unbound, BIND or dnsmasq for your own machines, bind it to localhost or a WireGuard interface, or restrict recursion to your own ranges. For authoritative servers, enable response rate limiting. Test from an outside machine; a resolver that answers a recursive query for a domain it does not host is open.

# from another network: should be REFUSED or time out
dig @203.0.113.30 example.org A +recurse +time=2
# Unbound: answer only local clients
access-control: 127.0.0.1/32 allow
access-control: 10.60.0.0/24 allow
access-control: 0.0.0.0/0 refuse

How are servers here protected against DNS floods?

By the DDoS filtering included with every machine. Volumetric floods, including reflected DNS traffic aimed at your address, are detected at the network edge and scrubbed before they reach your port, while legitimate traffic continues. If you host authoritative DNS yourself, combine that with a second name server in another data centre, such as Frankfurt and Beauharnois, or with a second DNS provider, so one site under attack does not take the domain offline. Our DDoS protection on bare metal article describes how the filtering works.

What is a random subdomain attack?

A flood of queries for names like x7f3q.example.net that do not exist, so no cache can answer and every query reaches the authoritative servers. Resolvers around the world forward them faithfully, which also strains the resolvers. Defences include rate limiting per source on the authoritative side, enabling aggressive use of DNSSEC-validated negative answers on resolvers, and enough capacity spread across locations. Answers for nonexistent names should carry a sensible negative caching time in the SOA record.

What does DNS tunnelling look like?

Unusually long, high-entropy names queried at a steady rate to one domain, such as 4a6f686e...q.tunnel.example.com, with data encoded in the labels and replies carried in TXT records. Malware uses it to talk to its controllers through networks that allow only DNS. On servers, watch resolver logs for long labels and high query rates to a single unfamiliar domain, and route all server DNS through your own resolver so you can see it. Our Intrusion prevention systems article covers tools that flag such patterns.

How do hijacking and poisoning differ?

Hijacking changes the real records by taking over the account or the registry entry; poisoning leaves the records alone and plants forged answers in resolver caches. Hijacking affects everyone and lasts until fixed; poisoning affects users of the poisoned resolver for the cache lifetime. Registrar security stops the first, DNSSEC stops the second. Our DNS poisoning and DNS security articles go further into each.

Related pages

DNS security

Protecting domains and lookups: registrar locks, DNSSEC signing, encrypted transports, resolver hardening and the records that stop email spoofing.

Read more

DNS poisoning

How forged DNS answers send users to the wrong server, cache poisoning against hijacking, DNSSEC validation, resolver hardening and protecting your domains.

Read more

DDoS protection on bare metal

How network edge filtering stops volumetric attacks before they reach your port, and what you still handle yourself.

Read more

How DNS works

From a typed name to an IP address: resolvers, root and TLD servers, authoritative zones, record types, TTLs and caching, with the commands to watch it happen.

Read more

Questions and answers

What is a DNS amplification attack?

An attack where spoofed queries to open resolvers produce large replies sent to a victim, multiplying the attacker traffic many times.

Does DDoS protection cover DNS floods?

Yes. Every server here includes network DDoS filtering that scrubs volumetric floods, including reflected DNS traffic, before it reaches the port.

How do I check whether my resolver is open?

Query it for an unrelated domain from a different network. If it returns an answer instead of refusing, it is open and must be restricted.

What is DNS tunnelling?

Hiding data inside DNS queries and replies to pass through networks that only allow DNS. It shows up as long, random-looking names queried often.

How do I protect my domain from hijacking?

Secure the registrar account with a unique password and two-factor login, enable transfer and registry locks, and alert on any name server change.