Skip to content

Interview question · Network Security & Protocols

How does DNS resolution work, how is it attacked, and what do DNSSEC and encrypted DNS each protect?

DNSSEC and DNS over HTTPS are often named in the same breath and protect entirely different things. The scored answer separates authenticity of the record from privacy of the query.

mediumEssentialNewPreparation tags: Google, Amazon, CiscoUpdated Nov 2026

TL;DR: A stub resolver asks a recursive resolver, which walks the root, the top-level domain and the domain's authoritative servers and caches answers for their TTL. Attackers forge answers to poison a resolver's cache (made much harder by randomising query IDs and source ports after the 2008 Kaminsky attack), run a malicious resolver on a network they control, or take over the domain itself through the registrar or DNS provider. DNSSEC lets a validating resolver verify that records were signed by the zone's key, defeating forgery and poisoning, but it does not encrypt anything. DNS over HTTPS or TLS encrypts and authenticates the hop from client to resolver, providing privacy and integrity on that link, but trusts the resolver. Neither replaces TLS certificate validation, which still catches a wrong IP for an HTTPS site.

How to approach it

Explain resolution and caching first, because poisoning only makes sense with the cache in mind. Then group attacks by where they happen (on the path, at the resolver, at the authoritative side, at the registrar), and map DNSSEC and encrypted DNS onto those positions precisely.

A strong answer

FIG · DNS · A RACE THE ATTACKER MUST WINpost-2008 defences
Cache poisoning: forged answers race the real one

Random query IDs and source ports make the race hard; DNSSEC makes a forged answer fail validation.

Client

stub resolver

Recursive

caches answers

Authoritative

root → TLD → zone

Attacker

off path

  1. Lookup
  2. Client to Recursive

    1bank.example A?
1/5

1. bank.example A?

Often over plain UDP; DoH or DoT would protect this hop.

Resolution. The client's stub resolver sends a query (UDP, port 53 by default) to a recursive resolver. If the answer is not cached, the resolver asks a root server for the TLD's servers, then the TLD's servers for the domain's authoritative servers, then those for the record. It caches each answer for its TTL and returns it to the client. A query is matched to a response by the 16-bit transaction ID and the source port.

Attacks by position.

  • Off-path cache poisoning. The attacker races the real authoritative answer with forged responses, guessing the transaction ID (and, before 2008, the fixed source port). Dan Kaminsky's 2008 technique made this practical by querying random subdomains so the race could be repeated many times, and by injecting authority records that redirected the whole domain. The response was source port randomisation across resolvers, multiplying the guess space, plus later hardening (0x20 case randomisation, stricter response validation).
  • On-path or local network. On hostile Wi-Fi, a rogue DHCP server or the access point itself supplies a malicious resolver, or the attacker answers queries directly.
  • Resolver compromise. A compromised or malicious resolver answers whatever it likes for its users.
  • Authoritative and registrar side. An attacker who takes over the domain's registrar account or DNS provider changes the records at the source, which no cache defence can detect; several notable incidents redirected organisations' mail and login domains this way.
  • Dangling records. A CNAME pointing to a decommissioned cloud resource lets someone claim that resource and serve content on your subdomain (subdomain takeover).

DNSSEC: authenticity of the data. Each zone signs its records; the parent zone vouches for the child's key with a DS record, forming a chain up to the root's trust anchor. A validating resolver rejects records that do not verify, which defeats forgery and cache poisoning. Limits: it does not encrypt, many domains do not sign, validation usually happens at the resolver (so the last hop to the client is unprotected unless that is also secured), and it does not help if the attacker controls the signing zone through the registrar.

Encrypted DNS: privacy and integrity of the hop. DNS over TLS (port 853) and DNS over HTTPS (port 443) encrypt and authenticate the connection between client and resolver, so a network observer cannot read or tamper with queries on that link. Limits: the resolver sees everything and could lie; it does not prove records came from the zone owner.

Stops forged records in a cacheHides queries from the networkTrusts the resolver
DNSSEC (validating resolver)YesNoFor validation, yes
DoT / DoHOnly on the client-resolver hopYesYes
TLS certificate validationStops connection to an impostor for HTTPSNoNo

Defences for your own domains. Registrar lock and MFA on registrar and DNS provider accounts, DNSSEC signing, monitoring of record changes and Certificate Transparency for unexpected certificates, cleaning up dangling CNAMEs, and email records (SPF, DKIM, DMARC) to protect the domain's mail identity.

What interviewers probe next

  • "If DNS is poisoned for a bank's domain, are users compromised?" For HTTPS with valid certificate checking and HSTS, the attacker cannot present a trusted certificate, so connections fail. Users of plain HTTP or apps without proper validation are exposed.
  • "Why do enterprises sometimes dislike DoH?" It can bypass the organisation's resolver and its filtering and logging; they configure endpoints to use the corporate resolver.
  • "What is a subdomain takeover?" A DNS record still points to a cloud resource you deleted; someone else creates a resource with that name and serves content on your subdomain.

What if?

What if · interview follow-ups

Hold your answer as the constraints change

A company's recursive resolver serves 5,000 employees, and someone asks how an attacker could make it return a false address for the company's SSO domain.

  1. Start here

    How does recursive resolution work?

How it's scored

Weak: "DNSSEC encrypts DNS."

Hire: Explains recursive resolution and caching, cache poisoning and the randomisation fix, and distinguishes DNSSEC (authenticity) from DoH/DoT (privacy).

Strong Hire: Groups attacks by position including registrar takeover and dangling records, explains the Kaminsky technique and its mitigations, states DNSSEC's chain of trust and deployment limits, tabulates what each control protects, and connects back to TLS validation and domain hygiene.

Common mistakes

  • Saying DNSSEC provides confidentiality.
  • Believing encrypted DNS proves record authenticity.
  • Ignoring registrar and DNS-provider account takeover.
  • Forgetting dangling DNS records.
You just read a free answer. Every topic opens its first 5 answers to anyone. Sign in and the count per topic goes to 10, and we keep track of how far you get in every topic.Google sign-in · free · no payment details
HOW DID IT GO?
0
READING SIGNED OUT

Signing in doubles your free answers, from 5 to 10 per topic, and the site starts remembering you: mastery per topic, bookmarks, and a next-focus recommendation. Free, no card.

Sign in free
UP NEXT ON YOUR JOURNEY
DISCUSSION · 0

No comments yet. Share a correction or a different way to answer it.