DNS

The internet's naming system — record types, resolvers, caching and DNSSEC.

3 min read 4 lesson sections
  • #resolver
  • #records
  • #dnssec
  • #bind
DNS: The internet's naming system — record types, resolvers, caching and DNSSEC.
Concept map

The Domain Name System (DNS) is a distributed directory that maps names such as learn.example to information clients need to reach services. A stub resolver on a device usually asks a recursive resolver to find an answer. If the answer is not cached, the resolver follows referrals through the DNS hierarchy until it reaches a server authoritative for the requested domain.

Remember: DNS is like a contacts list for services. Caching is why changing an entry does not update every copy instantly.

Common record types

  • A maps a name to an IPv4 address; AAAA maps it to IPv6.
  • CNAME aliases one name to another name.
  • MX identifies mail exchangers for a domain.
  • TXT stores text used by services, including domain verification and email policies.
  • NS identifies the authoritative name servers for a zone.

A DNS zone is a portion of the namespace managed together. The authoritative provider publishes its records, while recursive resolvers answer clients and cache responses according to each record’s time to live (TTL). A cached answer can remain visible until its TTL expires, which is why a change is not always seen everywhere immediately.

Query and troubleshoot

On systems with dig, ask a resolver for a record:

dig example.com A
dig example.com MX
dig +trace example.com

The first two queries request specific record types. +trace displays the delegation path from the DNS root, which can help distinguish a problem with a resolver’s cache from a problem in the authoritative delegation. Check the returned status, answer section, TTL, and which server responded; a missing answer is not always a network failure.

When diagnosing a name that points to the wrong service, verify the record at the authoritative provider, check for conflicting records, and account for cached TTLs. For split-horizon DNS, the same name can intentionally return different answers inside and outside an organization, so compare results from the relevant networks.

Interactive diagram

Client subnet 192.0.2.0/24DNS hierarchyRecursive queryRecursive queryIterative queryIterative queryIterative queryIterative queryIterative queryIterative queryReferralReferralReferralReferralRecursive queryDNS · 53Stub resolver192.0.2.10Stub resolver — 192.0.2.10Recursive resolver198.51.100.53Recursive resolver — 198.51.100.53Root server198.51.100.1Root server — 198.51.100.1TLD server198.51.100.2TLD server — 198.51.100.2Authoritative server198.51.100.3Authoritative server — 198.51.100.3
Legend

Current step

The stub asks one recursive question

The client asks for a name, not for a server, and sets the recursion-desired flag.

Question
www.example.com
Record type
A
Recursion
Requested
The client asks one question and waits; the resolver does the walking. Each referral moves one level closer to the answer, and the TTL in the final record decides how long the resolver may answer from cache without asking again.

Documentation example: addresses use the RFC 5737 ranges and ASNs use the reserved private range. Nothing here connects to a real network.

Interactive diagram

Local reachabilityLocal reachabilityQuery times outQuery times outresolver ↔ authoritativeClient192.0.2.25Client — 192.0.2.25Default gateway192.0.2.1Default gateway — 192.0.2.1Recursive resolver192.0.2.53Recursive resolver — 192.0.2.53Authoritative DNS203.0.113.53Authoritative DNS — 203.0.113.53
Legend

Current step

Confirm the client configuration

Check the assigned resolver address, search suffix and whether the client is using the expected network interface.

Choose the next test

The client can reach its default gateway but DNS queries time out. What should you test next before changing configuration?

Reveal diagnosis

Test reachability and service response from the client to the configured resolver, then inspect resolver health and upstream resolution separately.

Test one boundary at a time and record the result. A timeout is a symptom, not proof of a specific failure; compare name lookups with direct IP connectivity and inspect the resolver path.

Documentation example: addresses use the RFC 5737 ranges and ASNs use the reserved private range. Nothing here connects to a real network.

Integrity and privacy

DNSSEC lets validating resolvers verify signed DNS data and detect tampering; it does not encrypt DNS queries. DNS over HTTPS (DoH) and DNS over TLS (DoT) encrypt the connection between a client and its chosen resolver, but do not by themselves prove that a domain’s answer is trustworthy. These technologies address different parts of DNS security.

DNS knowledge is useful for nearly every internet service. Learn to read record types, follow delegations, understand caching, and verify answers from more than one point in the resolution path.

Trusted references