Skip to main content
DNS Lookup

In the previous article, we learned what DNS is and why we need it.

Now, let's understand what happens behind the scenes when you enter a domain name like google.com in your browser.

This process is called a DNS Lookup.

1. What Is a DNS Lookup?

A DNS Lookup is the process of finding the DNS record related to a domain name.

For example, when you visit google.com, your device needs to find the correct IP address to connect to the website.

DNS helps your device get this information.

But how does this happen?

Let's explore the main components.

2. DNS Resolver

A DNS Resolver is a server that receives DNS queries from your device and works to find the requested DNS information.

When you enter a domain name in your browser, your device sends a DNS query to a resolver.

The resolver checks its cache first.

If it already has the answer, it can return it immediately.

If not, it starts asking other DNS servers to find the answer.

3. DNS Cache

A DNS Cache stores DNS information for a period of time.

For example, if someone recently visited google.com, the resolver may already have its IP address stored in its cache.

Instead of repeating the full lookup process, it can return the stored result.

This makes DNS lookups faster and reduces unnecessary queries.

DNS records are not stored forever. Their caching time is controlled by a value called TTL (Time To Live).

4. Root DNS Servers

Root DNS Servers are at the top of the DNS hierarchy.

They do not usually provide the final IP address of a website.

Instead, they direct the resolver to the correct TLD DNS Servers.

For example, if the domain is example.com, the Root Server directs the resolver to the DNS servers responsible for the .com extension.

5. TLD DNS Servers

TLD (Top-Level Domain) DNS Servers are responsible for domain extensions such as:

  • .com
  • .org
  • .net
  • .edu

Their job is to direct the resolver to the Authoritative DNS Servers responsible for the requested domain.

For example, the TLD server for .com helps the resolver find the authoritative DNS servers for example.com.

6. Authoritative DNS Servers

An Authoritative DNS Server stores the actual DNS records for a domain.

These records may include:

  • A Record: Maps a hostname to an IPv4 address.
  • AAAA Record: Maps a hostname to an IPv6 address.
  • MX Record: Specifies the mail servers for a domain.
  • CNAME Record: Points one hostname to another hostname.

When the resolver reaches the authoritative server, it can get the requested DNS record.

The authoritative server returns the answer to the resolver.

7. The Complete DNS Lookup Process

Let's put everything together.

Imagine you enter example.com in your browser.

Here is what happens:

  1. Your device checks its local DNS cache.
  2. If the answer is not available, your device sends a query to a DNS Resolver.
  3. The Resolver checks its own cache.
  4. If the answer is not cached, the Resolver asks a Root DNS Server.
  5. The Root Server directs it to the correct TLD DNS Server.
  6. The TLD Server directs it to the domain's Authoritative DNS Server.
  7. The Authoritative Server returns the requested DNS record.
  8. The Resolver sends the answer back to your device and may cache it.
  9. Your browser can now use the returned IP address to connect to the website's server.

Important: Not every DNS Lookup needs to contact all these servers. If the answer is already cached, the resolver can return it without repeating the full process.

Summary

DNS Lookup helps your device find the DNS information needed to reach a domain.

Each component has a different responsibility:

Component Main Responsibility
DNS Resolver Finds the requested DNS information
DNS Cache Stores DNS results temporarily
Root DNS Server Directs queries to TLD servers
TLD DNS Server Directs queries to authoritative servers
Authoritative DNS Server Returns the actual DNS records

Understanding DNS Lookup helps developers understand what happens when users access websites and when domain-related problems occur.

In the next article, we will explore IP Addresses, including IPv4, IPv6, Public IP, and Private IP.

About the author

  • Software Engineer blending deep algorithmic problem solving with scalable Frontend Architecture. Obsessed with high-performance web systems, Core Web Vitals, accessibility, and modern UI engineering.

No comments yet. Be the first to comment.

DNS & Domain Fundamentals for Developers

Part 2 of 10

A practical introduction to DNS and domain fundamentals for developers. Learn how domain names work, how DNS lookups happen, and how DNS records connect your domain to websites, servers, and email services. This series explains the concepts developers commonly face when deploying projects, connecting custom domains, configuring DNS records, and troubleshooting domain-related issues. The goal is to understand what happens behind the scenes without going too deep into networking.

Up nextIP Addresses : IPv4, IPv6, Public and Private IPsEvery device connected to a network needs a way to communicate with other devices. This is where IP Addresses come in. In this article, we will learn what an IP address is, understand the difference b

More from this blog