INFRASTRUCTURE LEARNINGINFRASTRUCTURE LEARNING
インフラ大全インフラ大全IT INFRASTRUCTURE / LEARNING
Infrastructure learning guide
Find a lesson or lab/

Esc to close · Search terms stay on your device

LEARNING日本語

Topic lessonTopic: Networking foundations

How DNS works: resolution, records and caching explained

DNS (Domain Name System) is a distributed system for querying information about names. For a website, it can resolve a hostname to an IP address. Receiving a DNS answer does not establish that a web page can be loaded. Separate the client, the resolver that finds an answer and the authoritative server that holds the zone’s information.

What you will learn

Trace the roles in name resolution, read common record types, explain caching and distinguish DNS problems from web-service problems.

Prerequisite

Know that an IP address identifies a network destination. Names and addresses here are illustrative; this lesson performs no DNS queries or configuration changes.

Separate clients, recursive resolvers and authoritative servers

DNS roles: a valid cached answer can avoid further queries
DNS roles: a valid cached answer can avoid further queries1: Client resolver — The client asks about a name and record type; local resolution paths vary. — Recursive resolver. 2: Recursive resolver — Follow delegation as needed. Root and TLD referrals are omitted from this role diagram. — Authoritative server. 3: Recursive resolver — Reuse valid information where available instead of contacting every server for every lookup. — Cache123Client resolverRecursive resolverAuthoritativeserverCacheDNS roles: a valid cached answer can avoid further queries1: Client resolver — The client asks about a name and record type; local resolution paths vary. — Recursive resolver. 2: Recursive resolver — Follow delegation as needed. Root and TLD referrals are omitted from this role diagram. — Authoritative server. 3: Recursive resolver — Reuse valid information where available instead of contacting every server for every lookup. — Cache123Client resolverRecursiveresolverAuthoritativeserverCache
  1. Client resolver → Recursive resolverThe client asks about a name and record type; local resolution paths vary.
  2. Recursive resolver → Authoritative serverFollow delegation as needed. Root and TLD referrals are omitted from this role diagram.
  3. Recursive resolver → CacheReuse valid information where available instead of contacting every server for every lookup.
Client resolver
Receives an application’s request and uses its configured resolution path.
Recursive resolver
Finds an answer, potentially using cached information.
Authoritative server
Answers from its knowledge of an authoritative zone.
Cache
Retains answers for a limited time; it may not reflect a recent change.

An authoritative DNS server and a web server have different jobs. A recursive resolver can follow referrals from the root through a TLD to the relevant zone. Clients and browsers can also retain information, so not every page load produces the same sequence of external queries.

The record type is part of the question

Common records for web and mail
TypeInformationDistinction
AAn IPv4 addressNot page content or a URL path
AAAAAn IPv6 addressA separate address family, not an alias for A
CNAMEAn alias to another nameNot a record containing the final IP address
MXA mail exchangerA mail-routing role, not the web destination
NSAn authoritative name server for a zoneA DNS role, not the website’s content server

In https://www.example.com/docs/, the hostname is www.example.com. The scheme identifies HTTPS and /docs/ is a path sent to the web service. An A record does not store that whole URL.

TTL limits caching; it is not a global completion time

A record’s TTL bounds how long it may be cached. Updating the authoritative data can leave valid older answers in other caches. Lowering a TTL immediately before a change does not retroactively shorten the original lifetime of every previously cached answer.

Negative information can also be cached. NXDOMAIN, meaning that the name does not exist, differs from an existing name with no data of the requested type. Keep the response and the resolver that returned it rather than calling every failure a DNS outage.

Worked example: some clients still see an old address

Turn observations into the next check
ObservationNext checks
Authoritative A data has the new valueVerify the zone, exact name and record type changed
One resolver still returns an old valueInspect its cache lifetime, query destination and observation time
DNS returns the new IP but the page failsInvestigate reachability, TLS, HTTP and application responses separately
The response is NXDOMAINCheck spelling, zone, delegation and negative caching

Choose an option to see the result and explanation.

An A-record query returned an address. Is the web application therefore healthy?
Read the answer and reason

Answer: No: connectivity and the web response still need checks · A DNS answer establishes the result of that query. It does not prove the network path, TLS connection, HTTP behavior or application authorization.

Collect the question and answer before changing settings

  1. Confirm the exact hostname and required record type.
  2. Record the resolver, response, TTL and observation time.
  3. Compare authoritative data with resolver results.
  4. Distinguish no response, negative answers, stale data and unexpected data.
  5. When DNS is as expected, continue with connectivity, TLS and HTTP.

Check, then explain in your own words

  1. Explain the client, recursive and authoritative roles.
  2. Distinguish A, AAAA, CNAME, MX and NS records.
  3. Use DNS evidence to choose the next connectivity or web-service check.
Check your understanding: Does lowering the TTL now immediately invalidate everyone’s old answer?

No. Previously cached answers have their existing lifetimes.

An authoritative update and the contents of distributed caches are separate observations. Compare the actual resolver, answer and time before deciding what a user is seeing.

Sources and conditions checked

Primary references are collected here with their scope, conditions and corresponding sections. Independent expert review and live-environment validation have not been performed.