An independent engineering field journalUnderstanding the systems behind the screen
Field note   ·   November 2026

DNS knows the name. Why can it still send you to the wrong place?

DNS caching, TTLs, recursive resolvers, and the difference between changing a record and changing a live connection.

Documenting the mechanism. Testing assumptions. Keeping the unknowns visible.

The sentence that fooled me: “DNS turns names into IP addresses.”

That definition is correct but incomplete. DNS is a distributed lookup system with multiple record types, caches at several locations, and delegation between authorities. When a hostname starts pointing somewhere new, there may be multiple valid answers in use for a while.

Imagine changing an application endpoint from server A to server B. Some clients connect immediately to B. Others still reach A. If you think DNS is one centrally updated address book, this looks impossible. If you think in terms of cached answers and their lifetimes, it starts to make sense.

Who asks whom?

A typical application uses an operating system or configured recursive resolver. If the answer is cached, the resolver can return it immediately. If not, the resolver may ask a root server where to find information about a top-level domain, follow the referral to a TLD server, and then contact the authoritative server for the domain. This is a hierarchy of responsibility—not a sequence in which every server knows the final IP.

Cache miss (simplified)
Client → Recursive DNS resolver
                ↓
           Root nameserver
                ↓ referral
           .com nameserver
                ↓ referral
           Authoritative server
                ↓ answer + TTL
Client ← Recursive DNS resolver

Recursive refers to the resolver taking responsibility for returning an answer to its client. Iterative refers to following referrals until an authoritative answer is found. Those are roles in a resolution process, not necessarily two separate network protocols.

A, AAAA, CNAME, NS, MX: different questions.

  • A maps a hostname to an IPv4 address; AAAA maps it to an IPv6 address.
  • CNAME says a name is an alias for another canonical name.
  • NS identifies authoritative nameservers for a zone or delegation.
  • MX tells mail senders which mail exchanger handles a domain's email.

A single organization can have a web server at one address and email infrastructure somewhere else. An MX answer isn't a replacement for an A answer; it answers a different application question.

The TTL trap.

TTL is the maximum age that a compliant DNS cache should reuse a response without refreshing it. If a resolver cached an old record when its TTL was high, lowering the TTL on the authoritative server now does not retroactively erase that old cached answer. Some clients may also reuse an already-open TCP connection to the previous server; DNS is not consulted for every HTTP request on an existing connection.

Changing DNS is not the same as moving every active connection.

That was a useful “first click” for me: successful name resolution and application reachability are separate facts. After a migration, test the answer from the resolver the client actually uses, then check the destination IP and connection independently.

Make the answer visible on your Mac.

# Ask the system's default DNS path through dig
dig example.com A

# Look at a domain's mail exchangers
dig example.com MX

# Ask an explicit public resolver
dig @1.1.1.1 example.com A

Compare the ANSWER SECTION, the record types, and the returned TTLs. If values differ, don't immediately assume one is incorrect: cache state, time, and DNS policies can differ between resolvers.

Learning checkpoint

Why might your browser keep reaching an old IP after an authoritative record has changed?

A resolver may still hold an unexpired cached record, the browser or OS may cache separately, or the browser may reuse an existing connection. Diagnose which one actually applies rather than clearing every cache by reflex.

← All articlesFollow the learning path ↗