Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is DNS and How Does It Work?

DNS turns names into addresses through a hierarchy of delegated zones. It is also an attacker’s favourite control point and one of the richest sources of detection data.

Illustration for the cybersecurity term DNS
Home / Blog / Cybersecurity Terms / What Is DNS and How Does It Work?
17 November 2026

What Is DNS and How Does It Work?

What Is DNS and How Does It Work?

Every connection begins with a question: what address does this name belong to? The Domain Name System answers it, using a distributed hierarchy specified in RFC 1034 and RFC 1035 back in 1987 and extended steadily since. It is the most heavily used service on the internet, and because almost nothing happens without it, control of a name is often worth more to an attacker than access to a server.

Resolution, Step by Step

When a client asks for www.example.co.uk, it sends the query to a recursive resolver, typically run by its organisation or its internet provider. If the resolver has no cached answer, it walks the hierarchy. It asks a root server, which refers it to the servers for .uk. It asks those, which refer it to the servers for co.uk, and then to the authoritative servers for example.co.uk, which finally return the answer. The resolver caches the result for the time-to-live stated in the record and returns it to the client.

Three roles are worth separating because they fail differently: the registrar, where the domain is registered and the nameservers are set; the authoritative server, which holds the zone; and the resolver, which clients query. Compromise at any one of them redirects traffic, and the registrar is usually the softest target.

Records You Need to Know

TypePurposeSecurity relevance
A / AAAAIPv4 and IPv6 addressesStale records pointing at released cloud addresses enable subdomain takeover
CNAMEAlias to another nameDangling aliases to deprovisioned services are the classic takeover route
MXMail exchangersChanging these redirects all inbound mail
TXTFree textCarries SPF, DKIM, DMARC, and domain ownership proofs
NSDelegationChanging these at the registrar hands over the whole zone
CAAPermitted certificate authoritiesLimits who can issue certificates for the name
PTRReverse lookupUsed in mail reputation and in investigation

How DNS Is Attacked

Registrar account takeover is the highest-impact version and needs no technical flaw at all, only a weak password or a social engineering call to support. The Sea Turtle campaign documented by Cisco Talos in April 2019 did exactly this against registrars and registries in the Middle East and North Africa, redirecting government and military domains long enough to obtain valid certificates and harvest credentials.

Cache poisoning inserts forged answers into a resolver, an attack made famous by Dan Kaminsky in 2008 and revisited in 2020 with the SAD DNS side channel. Source port randomisation and DNSSEC are the structural answers.

Resolvers also get abused rather than attacked. An open resolver becomes an amplifier in reflection attacks, and a compromised endpoint uses DNS as a covert channel, tunnelling data out inside query names when every other port is blocked.

Finally, subdomain takeover deserves its own mention because it is so common. A CNAME left pointing at a cloud service that has since been deleted lets anybody who claims that service name serve content, and read cookies, under your domain.

Defending and Using It

Start at the registrar: strong unique credentials, phishing-resistant multi-factor authentication, and registry lock on domains that matter. Sign your zones with DNSSEC and publish CAA records. Audit the zone quarterly for records pointing at infrastructure you no longer own. Restrict recursion on your own servers to your own clients, and enforce internal clients to use your resolvers rather than reaching out to external ones.

Then use it defensively. Resolver logs are among the highest-value telemetry a SOC has: they reveal command-and-control beaconing, newly registered domain contact, tunnelling, and the first move of most malware, often before any payload runs. The NCSC’s Protective DNS service provides this filtering free to UK public sector organisations, and commercial equivalents exist for everyone else.

Our Infrastructure and Architecture Review Services include a full zone and registrar review, which frequently turns up records nobody has looked at in years.

FAQ – Frequently Asked Questions

What Is the Difference Between a Recursive and an Authoritative Server?

An authoritative server holds the actual records for a zone and answers questions about it. A recursive resolver holds no zone data; it asks the hierarchy on a client’s behalf, caches the answer, and returns it. Running both roles on one server is poor practice, because recursion exposed to the internet turns your authoritative infrastructure into an open resolver.

Why Is DNS Logging Useful for Detection?

Because almost every action starts with a lookup. Resolver logs show malware contacting command-and-control infrastructure, data leaving through DNS tunnels, users reaching newly registered or typosquatted domains, and the spread of an infection across hosts. The volume is high but the records are small, and the signal often appears before anything else in the environment reacts.

What Is a Subdomain Takeover?

A record, usually a CNAME, points at a third-party service that has since been deleted or never claimed. An attacker registers that service name, and your subdomain now serves their content. Because it is genuinely your domain, it can be used for convincing phishing and may expose cookies scoped to the parent domain. Regular zone audits prevent it.

Should Internal Clients Use Public DNS Resolvers?

Generally no. Internal clients should use your own resolvers so that internal names resolve, your filtering applies, and you retain the logs. Block outbound UDP and TCP port 53 to anything except your resolvers, and set policy to disable encrypted DNS in browsers, otherwise clients will quietly bypass your controls and your visibility disappears.

Related Terms

You May Be Interested In These

What Is MITRE Engage?

Cybersecurity Terms

17 November 2026

What Is MITRE Engage?

Read More
What Is NetFlow Anomaly Detection?

Cybersecurity Terms

17 November 2026

What Is NetFlow Anomaly Detection?

Read More
What Is OpenID Connect?

Cybersecurity Terms

17 November 2026

What Is OpenID Connect?

Read More