Skip to content
WebsiteHosting.com

concept Domains & DNS

DNS resolution

Trace cold and cached DNS lookups, distinguish referrals from answers, and see why NXDOMAIN, NODATA and an HTTP response are different outcomes.

Sources checked · P0013

What it means

DNS resolution obtains DNS data for a name and record type, often using a recursive resolver that follows referrals and reuses cached answers. For a website, an A or AAAA answer may supply an IP address, but DNS does not retrieve the site's HTML. A browser can connect and make an HTTP request only after the necessary name resolution and other connection steps have succeeded. A cached answer can shorten the lookup; a negative DNS answer is still a DNS result, not an HTTP error page. DNS concepts · Current terminology

Try it

Simulation — compare the path, not a stopwatch. Run the cold lookup to its answer, then repeat it: the resolver now has a usable cache entry. Advance the virtual clock to 299 seconds and then 300 seconds to inspect the ordinary expiry boundary. Other presets start with a cached answer, a known delegation, a nonexistent name, or a name that lacks the requested record type.

Trace a DNS lookup

Compare a cold path, cached answer and cached delegation. Step manually or run to the answer.

Simulation

www.example.com. A · t=0 s · Lookup path

  1. 1 · CurrentClient → recursive resolver
  2. 2 · Not visitedResolver checks its cache
  3. 3 · Not visitedResolver → root
  4. 4 · Not visitedResolver → .com
  5. 5 · Not visitedResolver → example.com authority
  6. 6 · Not visitedResolver → client
The stub asks its recursive resolver for www.example.com. A. The browser is not querying every authority itself.

Synthetic example.com zone; no DNS packets are sent. Virtual time is 0–900 s. Cache lifetime is 300 s from receipt in this ordinary-cache model.

About this model

The resolver, not the browser, follows referrals. A completed lookup stores its synthetic answer. Back reviews the existing trace; it does not undo a query. Repeat query starts a new trace using the resulting cache.

Virtual time only moves forward; Reset restores t=0. NXDOMAIN means the name is absent; NODATA means the selected RRset is absent. The ipv4.example.com preset has A but no AAAA.

This is not a full resolver: no aliases, DNSSEC validation, transport retries, QNAME minimization, forwarding or serve-stale. Negative-cache TTL is deliberately fixed here. In the cached-delegation preset, the delegation is assumed usable throughout the 0–900 s lesson.

Basis: RFC 1034, RFC 9499, RFC 2308.

The initial no-JavaScript example asks for www.example.com. A with an empty answer cache. Its prepared path reaches the example authority and returns 192.0.2.10. All addresses and answers are illustrative. Back reviews this lookup's steps; it does not reverse a query that already completed. Reset clears the trace, cached answer, clock, record choice and scenario.

Who asks whom?

The application typically uses a local resolver interface, often described as a stub, to ask a recursive resolver to obtain an answer. The recursive resolver may be provided by a network, an organization or a separately configured service. It can answer from information it already has or do further work. The client is not necessarily sending its own query to every server shown in a teaching diagram. Resolver roles

In the cold preset, the resolver starts without a useful final answer or delegation. A root server points it toward the .com servers. A .com authority points it toward the servers authoritative for example.com. The resolver then asks the appropriate authority for the requested data. The first two replies are referrals: directions to another part of the DNS hierarchy, not the web server's address. This example omits address-bootstrap and retry details. Referrals and resolver algorithm

ParticipantWhat it contributes in the cold presetWhat it does not do here
Client or stubRequests a name and typeWalk the whole hierarchy itself
Recursive resolverObtains and returns the resultHost the website's HTML
RootRefers toward the top-level domainReturn the final website address
TLD authorityRefers toward the delegated zoneServe every record below that zone
Zone authoritySupplies the example zone answerClear every other resolver's cache

The diagram is a role map, not a latency estimate. Real resolvers may use forwarding, already-cached delegation information, additional answers, retries or parallel work. The cached-delegation preset makes one such shortcut visible without trying to simulate every implementation.

A usable cache changes the path

A cached record has a remaining lifetime, not a universal appointment at which the internet changes. In this lab, an answer saved at time 0 with a 300-second teaching TTL remains usable at time 299 and expires at time 300. Repeating a query while the entry is usable does not restart that entry's lifetime. A newly obtained answer starts its own lifetime.

The scene uses an ordinary expiry-only policy. Real DNS includes additional mechanisms such as serve-stale behavior under specified conditions. Those are intentionally not simulated, so the lab's strict boundary must not be used as a guarantee about every production resolver. Caching and TTL · Serve-stale extension

An address, a missing name and a missing type

The A and AAAA choices ask for different record types: an IPv4 address and an IPv6 address respectively. The prepared ipv4.example.com name has an A record but no AAAA RRset. Asking for AAAA therefore produces the lab's NODATA result, described as NOERROR without that requested data. Asking for A succeeds. The name itself has not disappeared.

The missing.example.com preset instead returns NXDOMAIN. A resolver can cache negative results as well as positive answers. For real authoritative negative answers, the negative-cache lifetime is derived using SOA information; the lab uses a fixed 300 seconds only to keep the comparison readable. It does not calculate an arbitrary zone's negative TTL. Negative answers and caching

A CNAME is another distinct possibility: an alias can require following a different name before obtaining the desired type. This model does not implement alias chains, loops or a DNSSEC validator. A timeout or validation-related failure should not be casually relabelled as proof that the domain does not exist. DNS terminology and response distinctions

In practice

When investigating a lookup, record the exact fully qualified name, record type, resolver, time and response. Compare like with like: an A answer from one resolver and an AAAA result from another are not observations of the same query. An authoritative response and a recursive cached response answer different diagnostic questions.

Keep the next layer separate. A correct DNS answer may point to a destination that cannot serve the intended hostname, complete TLS or return the requested path. Conversely, receiving an actual HTTP 404 means an HTTP participant responded; it is not the same symptom as receiving NXDOMAIN. This distinction prevents changing DNS to solve a missing application route.

The useful mental model

Ask three questions: who has the requested data, what useful information is already cached, and what kind of answer came back? Root, TLD and authoritative servers describe a hierarchy of responsibility. Cache state determines how much of that hierarchy this lookup needs. Neither the number of arrows nor the virtual clock predicts a real visitor's loading time.

Frequently asked questions

Editorial questions, answered from the sources listed for this article.

Does every DNS lookup contact a root server?

No. A resolver can answer from a usable cache entry, or it can already know a relevant delegation. The full root-to-TLD-to-authority sequence in the cold preset is one explanatory path, not a promise that every request follows it.

Is NODATA the same as NXDOMAIN?

No. NXDOMAIN says the queried name does not exist in the relevant DNS answer. NODATA describes an answer with no data of the requested type; it is not a separate DNS response-code number. In the example, the name has A data but no AAAA data.

Sources & model boundaries

Primary references used for this explanation. The interactive example is an educational model, not a live check.

  1. RFC 1034 — Domain Names: Concepts and Facilities

    Sections 2.4, 3.1, 4.3.2 and 5. DNS tree, zones, referrals, resolvers and caching.

    Checked .

  2. RFC 1035 — Domain Names: Implementation and Specification

    Sections 3.2, 3.3 and 4. RR formats, TTL, A, NS, SOA, CNAME and MX records.

    Checked .

  3. RFC 9499 — DNS Terminology

    Sections 2–7. Terminology for authoritative servers, recursion, caching, and delegation.

    Checked .

  4. RFC 2308 — Negative Caching of DNS Queries

    Sections 3–6. NXDOMAIN and NODATA negative cache behavior and TTL.

    Checked .

  5. RFC 8767 — Serving Stale Data to Improve DNS Resiliency

    Sections 3–5; updates RFC 1034, RFC 1035 and RFC 2181. Serve-stale mechanisms are a real exception outside the ordinary TTL-only educational models.

    Checked .