The Resolver Asks on Your Behalf
At 08:55 someone opens https://shop.example.com on a laptop in Lisbon. The browser knows the name but not the address, and the address is not in the URL. Before a packet leaves for the shop, a short conversation happens between machines the user never configured and cannot see.
Think of a hotel concierge. You ask for the address of a bakery on Main Street. The concierge either knows it or starts calling: the city registry says "shops on Main Street are registered with the district office," the district office says "that bakery keeps its own records," and the bakery gives the street number. Each intermediate reply is a referral, not an answer. Only the bakery speaks for the bakery, and only the concierge hands you the address.
That is the shape of DNS. The concierge is a recursive resolver, the registry and district office are the root and TLD nameservers, and the bakery is the authoritative nameserver for the zone. The terms that make the rest readable:
| Term | What it is | Where it lives |
|---|---|---|
| Stub resolver | Sends one query and waits; never walks the tree | Your operating system |
| Recursive resolver | Walks referrals, caches answers, returns the final copy | Your ISP, or a public service such as 1.1.1.1 |
| Authoritative nameserver | Holds a zone and answers from that data; sets the AA flag | The zone owner or its DNS provider |
| Delegation | A parent publishes NS records pointing at the child's nameservers | The parent zone |
| TTL | Seconds a cache may reuse an answer | Every cache entry |
| RRset | Records sharing a name, type, and class; cached and expired as one unit | Every cache entry |
Start cold. Follow shop.example.com with nothing cached. The stub resolver asks the recursive resolver with recursion desired set; the resolver checks its cache, misses, and starts iterating with that bit cleared, because it is now doing the work.
- It asks a root server, which does not know the address. It returns a referral: the NS records for
.complus glue addresses. - It asks a
.comserver, which refers it toexample.com's nameservers — here Cloudflare's, such ashera.ns.cloudflare.com. - It asks one of those. This time the reply is an answer:
A 203.0.113.10, with the zone's TTL andAAset. - It caches the RRset for that TTL and returns a copy to the laptop.
Figure 1 draws the walk and the branch where the cache already has the answer.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
S["Stub resolver in the laptop"] -->|"1 query, RD=1"| R["Recursive resolver 1.1.1.1"]
R --> C{"Cached RRset with TTL left?"}
C -->|"yes"| HIT["Return cached answer, TTL counting down"]
C -->|"no"| ROOT["Root server: a.root-servers.net"]
ROOT -->|"2 referral: .com NS plus glue"| TLD["a.gtld-servers.net"]
TLD -->|"3 referral: example.com NS"| AUTH["Cloudflare authoritative NS"]
AUTH -->|"4 AA=1, A 203.0.113.10, TTL"| R
R -->|"5 cache the RRset"| HIT
AUTH -.->|"timeout, REFUSED, or lame"| ERR["SERVFAIL to the client"]
HIT --> S
classDef primary fill:#132440,color:#ffffff,stroke:#0b172b;
classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a;
classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f;
classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420;
classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f;
class ROOT,AUTH primary;
class S,R,TLD secondary;
class C,HIT ok;
class ERR danger;
The first lookup of a popular name rarely reaches the root: a cache hit ends it at step one. That is why the tree feels abstract until you force the walk with dig +trace, which we do later.
The boundary is trust, not geography. The laptop trusts its resolver; the resolver trusts a referral chain seeded by a root hints file. Only the authoritative server speaks for the zone, and only its reply carries AA. Figure 2 layers those responsibilities.
Delegation and Authoritative Answers
Delegation is one small RRset. The parent holds an NS RRset for the child — example.com. NS hera.ns.cloudflare.com. — and usually nothing else. A referral carries those NS records in the authority section, an empty answer, and AA=0.
Glue breaks the circular dependency
A child nameserver named inside its own zone creates a loop: the resolver cannot learn its address without first asking the zone it serves. The parent breaks that loop by adding A and AAAA records for those names in the additional section — glue. Cloudflare's nameservers sit under ns.cloudflare.com, outside the zones they serve, so a normal Cloudflare zone needs none.
Positive and negative caching are different clocks. Positive caching stores an answer for its TTL; negative caching stores the fact that a name or type does not exist. The second surprises people because its lifetime is not the TTL of any record: it comes from the SOA record's last field, MINIMUM. RFC 2308 defines the rule, and Cloudflare's troubleshooting guide points at that field when a new record "still does not resolve."
Ask the same question of two servers. On 2026-11-04 they returned the same addresses and disagreed only on the TTL and the flags:
Same data, different role. The authoritative server handed over the configured TTL; the resolver handed over what was left of its copy. The authority also warned that recursion was requested but not available — resolving other people's names is not its job.
Two servers, two jobs. The differences below are the ones that change how you debug:
| Dimension | Recursive resolver | Authoritative nameserver | What it means when it goes wrong |
|---|---|---|---|
| Source of truth | Its cache, filled by iteration | The zone file or API state | A wrong cached answer is stale, not forged |
| Recursion | Performs it on a miss | Refuses it; RA is clear | SERVFAIL often means the walk could not finish |
| Caching | Stores positive and negative answers | Serves its own TTLs, caches nothing else | Clearing a local cache does not clear an ISP's |
AA flag | Never set | Set on answers from the zone | Missing AA means you are reading a cache |
| TTL in reply | Seconds remaining | Full configured value | A climbing TTL means another cache instance |
| Who controls it | ISP, public resolver, your fleet | Zone owner and DNS provider | Delegation errors are fixed at the parent |
| Typical failure | Stale or negative entry, SERVFAIL | REFUSED, timeout, lame referral | Different symptoms need different commands |
| Plan boundary | 1.1.1.1 is a separate service | Cloudflare DNS: all plans | Authoritative DNS is not the proxy |
Supported is not the same as included
Cloudflare DNS is authoritative hosting; it does not resolve the internet for your visitors, and 1.1.1.1 is a separate product. Every plan can host a zone and flatten an apex CNAME, but flattening every CNAME is paid, and private-origin proxying is limited to some Enterprise customers.
Figure 3 shows the exchange as a sequence, including a delegation that does not answer.
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
sequenceDiagram
autonumber
participant C as Stub resolver
participant R as Recursive resolver
participant P as com TLD
participant A as Cloudflare NS
C->>R: A www.shop.example.com?
R->>R: cache lookup, miss
R->>P: NS example.com? (RD=0)
P-->>R: referral, NS hera.ns.cloudflare.com
R->>A: A www.shop.example.com? (RD=0)
alt Authoritative answer
A-->>R: NOERROR, A 203.0.113.10, TTL 300, AA=1
R-->>C: cached answer, TTL counting down
else Lame or unreachable delegation
A--xR: timeout, REFUSED, or no zone
R-->>C: SERVFAIL
end
Positive Answers, NXDOMAIN, and Cache Lifetimes
Four fields settle most arguments. dig gives you four things to read first: the status, the flags, the answer count, and the authority section. Together they separate a real answer from a cached one, a nonexistent name from a missing type, and a broken delegation from a slow one.
A positive answer is NOERROR with a nonzero answer count. No authoritative flag means a cache replied. The TTL you see is either the zone's configured value or whatever remains on a cache copy:
A single TTL reading is a sample, not a global fact. 1.1.1.1 is anycast, so two queries five seconds apart can land on different cache instances and show a TTL of 16 and then 45. Nothing was wrong in that case; the two answers simply came from different copies.
Four outcomes look alike and mean different things. The status, the answer count, and the authority section tell them apart:
| Outcome | Status | Answer count | Authority section | What it means |
|---|---|---|---|---|
| Positive answer | NOERROR | One or more | Empty, or the zone's NS | The record exists and this is its value |
| NXDOMAIN | NXDOMAIN | 0 | The answering zone's SOA | The name does not exist; the SOA bounds reuse |
| NODATA | NOERROR | 0 | Zone SOA | The name exists, but not for the type you asked |
| Signed-zone negative | NOERROR | 0 | Zone SOA | A real negative answer, not the textbook status |
NXDOMAIN carries the answering zone's SOA. A random .com label asked of 1.1.1.1 returned the TLD's SOA with TTL 900; that TTL is how long the negative answer may be reused.
A missing type is not a missing name. Conflating NODATA with NXDOMAIN sends people hunting for a missing record when the type is what is missing. Two DNSSEC-signed Cloudflare zones returned the signed-zone form for a nonexistent label — the negative answer is real even when the status is not.
Only the last SOA field drives negative caching. The five numbers after the primary server and contact are serial, refresh, retry, expire, and minimum. Only MINIMUM governs negative caching, and RFC 2308 caps the effective value at the smaller of the SOA's own TTL and that field. That is why "lower the TTL on the new record" does not help when a resolver already holds an NXDOMAIN: the entry predates the record, so the new record's TTL is irrelevant.
DNS propagation is a metaphor
"DNS propagation" is a metaphor, not a mechanism. An authoritative server serves a change as soon as the API accepts it; what takes time is other people's caches expiring. And a negative entry is governed by the zone's SOA MINIMUM, not by the TTL of the record you just added — lowering that TTL after the fact cannot evict it.
Lower the TTL one old TTL ahead
If a change is coming, lower the TTL at least one old TTL in advance, so the caches that matter already hold short-lived copies. Changing the TTL and the target in one edit leaves everyone who cached the old RRset with both the old TTL and the old address.
Why Two Users Can See Different Answers
A cutover makes the clock visible. Suppose the name points at one address with a one-hour TTL, and at 09:00 you change the target.
- A visitor whose ISP resolver cached it at 08:58 keeps the old address until about 09:58. Their browser and OS may hold copies too.
- A visitor whose resolver first asks at 09:01 gets the new address immediately.
- A visitor who queried
api.example.comat 08:40, before it existed, has a cached negative answer. With an SOAMINIMUMof 1800, the name stays invisible to that resolver until about 09:10 even though you created it at 08:45.
Three people, one zone, three experiences. None is a DNS bug; each is a different cache with a different clock. Figure 4 puts the windows on one timeline.
TTL is a staleness dial. Short TTLs shorten staleness, at the cost of more authoritative queries and less protection when those servers falter. Long TTLs absorb outages and cut query volume, at the cost of hour-long staleness during a migration. Cloudflare's proxied default is 300 seconds and cannot be edited, because the anycast addresses behind a proxied name must be able to move. DNS-only records run from 60 seconds to one day, or 30 seconds on Enterprise.
Boundary conditions explain most "DNS is inconsistent" reports:
- An RRset is cached as a unit. Two A records with different TTLs may expire unevenly, and some resolvers normalize to the lowest value. Keep a set uniform.
- A CNAME chain has a TTL per link, so effective staleness is the slowest link, not the name you edited.
- A resolver is not one computer. Anycast, per-instance caches, DoH, VPNs, and EDNS Client Subnet can make two queries differ without any record changing.
An apex CNAME only works when it is flattened
A CNAME cannot coexist with other data. RFC 1034 forbids it, and an apex always has SOA and NS. Cloudflare's CNAME flattening resolves the target and returns A or AAAA instead: the zone stays valid, but asking the apex for a CNAME returns nothing, which can send you looking for an alias problem that does not exist. The same zone moved to a provider without flattening fails outright.
Trace a Domain From the Root to Its Answer
The whole path fits in seven steps. Steps 1–5 work against any public name; steps 6–7 need a zone you control.
Trace a Domain From the Root to Its Answer
Execution status: design-only; not executed as a lab. Steps 1–5 were run read-only against public names on 2026-11-04; steps 6–7 need a controlled zone and were not executed, and no record change or timing measurement was performed.
Prerequisites. BIND 9's dig (preinstalled on macOS, packaged as bind9-dnsutils on Debian/Ubuntu) or kdig, plus outbound UDP/TCP 53. A domain you control is needed only for steps 6 and 7. No paid plan is required: authoritative DNS and apex CNAME flattening are available on all plans.
Setup. Work in a scratch directory and log your commands. If you control a zone, create ttl-lab.example.com with a 60-second TTL; otherwise run steps 1–5 against a public name and treat 6–7 as paper exercises.
- Cached view. Note each TTL in the answer.
- Repeat, then ask the authority. Five seconds later, expect a smaller TTL; a larger one is not a failure, since an anycast resolver can route elsewhere. The authority should return the full TTL with the authoritative flag.
- Walk the tree. Expect root servers, then
.comgTLD servers, then Cloudflare. The trace starts from local root hints and sends its own iterative queries, so it can differ from what your resolver cached. - Trim to delegations. The last non-empty authority section should name the assigned nameservers. If it names your old provider, the delegation is wrong, not the zone.
- Force a referral. Expect NS records in authority, an empty answer, and no authoritative flag — exactly what a resolver consumes at each hop. Asking the same server for the zone's NS instead returns the delegation in the answer section, because the parent is authoritative for it.
- Negative caching, with your own zone. Note the SOA's remaining TTL, create the record, then query again through the same resolver. Expect the negative answer to persist until that TTL expires. A Cloudflare-signed zone may answer NOERROR with zero answers instead of NXDOMAIN; either way the SOA is the countdown.
- TTL expiry, with your own zone. Set TTL 60, change the target, and poll every 15 seconds. Expect the flip only after the previous TTL elapses, not when the API returns success.
Failure checks. SERVFAIL from a resolver while the authoritative server answers means a broken delegation or DNSSEC validation failure. Missing aa on a server you believe is authoritative means you reached a cache. A trace that stalls at the root usually means port 53 is blocked or a VPN is intercepting. A TTL that never decreases means different resolver instances are answering.
Cost dimensions. Zero for the queries; a domain is typically USD 10–15 per year. A real low-TTL strategy multiplies query volume by roughly the reciprocal of the TTL.
Cleanup. Delete ttl-lab and any other throwaway records, restore the original TTL, and confirm with a final dig against the authoritative server.
Compare Recursive and Authoritative Results
Explain before you run. Ask the resolver and ask the authority; if they disagree, one answer is old, and the evidence says which.
Pass evidence. The recursive answer carries the recursion flags, no authoritative flag, and a TTL at or below the authoritative value. The authoritative answer sets AA and returns the full TTL. A trace reaches the nameservers the parent lists. A negative answer carries the zone SOA, and its remaining TTL matches the MINIMUM you read separately. After a TTL elapses, the recursive answer changes with no further action.
Fail evidence. An authoritative flag from an unexpected server, or a TTL higher than the authoritative server's, means you are not talking to the server you think. A resolver SERVFAIL while a direct query to the nameserver returns NOERROR points at a broken delegation or a DNSSEC validation failure. An NXDOMAIN that outlives the SOA MINIMUM, or a parent delegation naming a provider you left, points at the cache and the parent respectively. An apex CNAME query returning nothing while the site works is flattening, not a fault.
Self-check: negative answers. Why does a new record still return NXDOMAIN after you lower its TTL? The resolver cached a negative answer before the record existed, and that entry expires on the zone's SOA MINIMUM. What does a missing authoritative flag prove? That a cache replied, so the answer may be older than the zone.
Self-check: identity and aliases. Why can two queries to 1.1.1.1 five seconds apart show 16 and then 45? The resolver is anycast and the queries hit different instances with different cache ages. You move an apex CNAME to a provider that does not flatten, and the site breaks. Why? The apex CNAME only worked because Cloudflare flattened it; the protocol does not permit a CNAME beside SOA and NS.
Unresolved limitations. No controlled zone was modified, so no TTL expiry, negative-cache duration, or cutover timing was measured. Resolver behavior varies by operator and instance, and RFC 2308 permits a range.
Per-zone values. The SOA minimum is per zone: cloudflare.com returned 300 while example.com, also on Cloudflare, returned 1800. Limits change; values were checked on 2026-11-04 against the pages below, with DiG 9.10.6 on macOS.
Tooling caveat. kdig was not installed, so its syntax comes from the Knot DNS 3.6.2 manual, not from execution.
References (verified 2026-11-04):
- Cloudflare DNS overview: https://developers.cloudflare.com/dns/
- Time to Live (TTL): https://developers.cloudflare.com/dns/manage-dns-records/reference/ttl/
- DNS record types: https://developers.cloudflare.com/dns/manage-dns-records/reference/dns-record-types/
- General DNS issues and negative caching: https://developers.cloudflare.com/dns/troubleshooting/dns-issues/
- DNS FAQ, change timing: https://developers.cloudflare.com/dns/faq/
- Pending nameservers and
dig +trace: https://developers.cloudflare.com/dns/zone-setups/troubleshooting/pending-nameservers/ - CNAME flattening: https://developers.cloudflare.com/dns/cname-flattening/
- RFC 1034, domain concepts and resolution: https://www.rfc-editor.org/rfc/rfc1034
- RFC 1035, message format and TTL field: https://www.rfc-editor.org/rfc/rfc1035
- RFC 2308, negative caching: https://www.rfc-editor.org/rfc/rfc2308
- RFC 2181, clarifications including RRset TTLs: https://www.rfc-editor.org/rfc/rfc2181
- IANA root zone database: https://www.iana.org/domains/root/db
kdigmanual, Knot DNS 3.6.2: https://www.knot-dns.cz/docs/latest/html/man_kdig.html
Next in the Series
In Configure Records, Proxy Status, and DNSSEC, we'll explore Make DNS changes with a clear model of the orange cloud.