How DNS Translates Domain Names to IP Addresses: A Step‑by‑Step Guide
This article explains the DNS system, its hierarchical structure from root servers to local resolvers, and walks through the nine‑step process that converts a human‑readable domain name into an IP address, including record types, TTL, GTM, CDN, and application server interactions.
Why DNS Matters
During a recent interview, a candidate was asked about the DNS request process and struggled to answer, prompting a deeper look at the definitions and principles behind DNS.
DNS Meaning and Structure
DNS (Domain Name System) is an Internet service that maps human‑readable domain names (e.g., www.51cto.com) to IP addresses. It operates as a distributed database organized in three layers:
Root DNS servers store the IP addresses of top‑level domain (TLD) servers.
TLD servers handle three categories of domains: gTLD (generic, e.g., .com, .net), ccTLD (country code, e.g., .cn, .jp), and New gTLD (e.g., .xyz, .top).
Local DNS servers (often provided by ISPs) cache query results and act as the first resolver for end users.
The hierarchy can be visualized as:
Figure 1: DNS hierarchical structure.
DNS Resolution Process
The resolution of a domain name to an IP address involves nine steps, illustrated below:
Figure 2: Full DNS request flow.
The user enters a URL in the browser. The browser first checks its own cache for a matching IP.
If not cached, the operating system’s hosts file (e.g., C:\Windows\System32\drivers\etc\hosts on Windows or /etc/hosts on Linux) is consulted.
The query is sent to the Local DNS server provided by the ISP or campus network, which often satisfies the request from its cache (about 80% of cases).
If the Local DNS lacks the answer, it contacts a Root DNS server to obtain the address of the appropriate TLD server.
The TLD server (gTLD, ccTLD, or New gTLD) returns the authoritative Name Server for the domain.
The Name Server provides the domain’s A (address) record or CNAME (alias) record and sets a TTL (Time‑To‑Live) value.
If an A record is returned, the browser can contact the target IP; many large sites instead return a CNAME that points to a Global Traffic Manager (GTM).
The GTM performs global load balancing, directing the request to the nearest or healthiest server, often behind a CDN.
Static resources (HTML, CSS, JS, images) are fetched from the CDN cache, while dynamic content (e.g., product or order data) is retrieved from the application server behind a load balancer.
Conclusion
DNS servers translate URLs to IP addresses through a three‑tier hierarchy: Root, TLD, and Local DNS. The full resolution path typically traverses the browser cache, hosts file, Local DNS, Root DNS, TLD DNS, authoritative Name Server, GTM, CDN, and finally the application server, encompassing nine distinct steps.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
