Back to Articles
EngineeringTechnologyDNS

DNS: From Domain Name to IP Address

CIBIVISHNU A C
CIBIVISHNU A C
9 min2 views

When you open a website, you usually type something like:

1https://example.com

But computers don't really use example.com to find the server.

They use IP addresses, such as:

193.184.216.34

So how does your computer turn a domain name into an IP address?

The answer is DNS — Domain Name System.

You can think of DNS as the phonebook of the internet. You know a person's name, but you need their phone number to call them. Similarly, you know a website's domain name, but your computer needs its IP address to connect to the server.

Let's follow what happens when you type a website address into your browser.

What Happens When You Type a Domain Name?

Imagine you open your browser and type:

1https://example.com

Your browser needs to find the IP address of example.com.

The journey looks roughly like this:

1You type example.com
2 │
3 ▼
4 Browser checks
5 its cache
6 │
7 ▼
8 Operating system
9 DNS cache
10 │
11 ▼
12 DNS Resolver
13 │
14 ▼
15 Root Server
16 │
17 ▼
18 .com Server
19 │
20 ▼
21Authoritative DNS Server
22 │
23 ▼
24 IP Address
25 │
26 ▼
27 Browser connects
28 to the server

It looks complicated, but each step has a simple job.


First, What Is a Domain Name?

A domain name is a human-friendly name for a website.

For example:

1google.com
2github.com
3example.com

Computers ultimately communicate using IP addresses:

1142.250.x.x
220.205.x.x
393.184.x.x

Remembering IP addresses for every website would be difficult.

Imagine having to remember:

1142.250.72.14
220.205.73.8
3104.18.32.47

instead of:

1google.com
2github.com
3example.com

DNS solves this problem by connecting names to IP addresses.


Step 1: Your Browser Checks Its Cache

You type:

1example.com

The browser first checks whether it already knows the IP address.

If you recently visited the same website, the browser may already have the answer stored in its cache.

For example:

1example.com
2 ↓
393.184.216.34

If the cached information is still valid, the browser doesn't need to ask a DNS server again.

This makes the process much faster.

If the browser doesn't have the answer, the request continues.


Step 2: Your Computer Checks Its DNS Cache

The operating system can also maintain its own DNS cache.

For example:

1DNS Cache
2 
3example.com → 93.184.216.34

If the operating system already knows the answer, it can return it immediately.

But if the information isn't available, your computer sends the DNS request to a DNS resolver.


Step 3: The DNS Resolver

The DNS resolver is usually the DNS server configured on your device or network.

It might be provided by:

  • Your ISP
  • Your router
  • A public DNS service
  • Your organization's network

For example:

1Your Computer
2 │
3 │ "What is the IP of example.com?"
4 ▼
5 DNS Resolver

The resolver's job is to find the answer.

Importantly, the resolver may already have the answer in its own cache.

If it does:

1Resolver Cache
2 
3example.com → 93.184.216.34

it can immediately return the IP address to your computer.

If not, the resolver has to find the answer.

This is where the DNS hierarchy comes in.


Step 4: The Root DNS Server

The resolver starts by asking a root DNS server.

There isn't one single root server. DNS uses a distributed system of root servers around the world.

The resolver asks something like:

"I need to find example.com. Where should I look?"

The root server doesn't normally provide the IP address of example.com.

Instead, it points the resolver toward the server responsible for the .com domain.

1Resolver
2 │
3 │ Where is example.com?
4 ▼
5Root DNS
6 │
7 │ Ask the .com servers
8 ▼
9.com DNS

Think of the root server as saying:

"I don't know the exact address, but I know who handles .com domains."


Step 5: The TLD Server

Now the resolver asks a TLD (Top-Level Domain) server.

For:

1example.com

the TLD is:

1.com

There are different TLDs such as:

1.com
2.org
3.net
4.in
5.dev

The .com DNS servers know which authoritative DNS servers are responsible for individual .com domains.

So the resolver asks:

"Who is responsible for example.com?"

The .com server responds with information pointing to the authoritative DNS servers for example.com.


Step 6: The Authoritative DNS Server

Now we reach the server that actually knows the DNS records for the domain.

This is called the authoritative DNS server.

For example:

1example.com
2 │
3 ▼
4Authoritative DNS
5 │
6 ▼
793.184.216.34

The resolver asks:

"What is the IP address for example.com?"

The authoritative server provides the appropriate DNS record.

For an IPv4 address, this is usually an A record.

For IPv6, it is an AAAA record.

For example:

1example.com → 93.184.216.34

The resolver now has the answer.


Step 7: The Answer Travels Back

The result travels back through the resolver to your computer.

1Authoritative DNS
2 │
3 │ 93.184.216.34
4 ▼
5 DNS Resolver
6 │
7 │ 93.184.216.34
8 ▼
9 Your Computer

Your browser now knows where the website's server is.

The DNS part is finished.

But the website hasn't actually been loaded yet.

Now the browser can connect to the server.


Step 8: Your Browser Connects to the Server

Your browser now knows:

1example.com
2 ↓
393.184.216.34

It can use that IP address to establish a connection to the server.

For HTTPS websites, there are additional steps involving TCP and TLS before the browser sends the HTTP request.

Eventually, the browser sends something like:

1GET /
2Host: example.com

The web server processes the request and sends a response.

The browser then receives HTML, CSS, JavaScript, images, and other resources needed to display the page.

So the complete journey looks like:

1You
2 │
3 │ example.com
4 ▼
5Browser
6 │
7 ▼
8DNS Resolver
9 │
10 ▼
11Root DNS
12 │
13 ▼
14.com DNS
15 │
16 ▼
17Authoritative DNS
18 │
19 │ IP address
20 ▼
21DNS Resolver
22 │
23 ▼
24Browser
25 │
26 │ Connect to IP
27 ▼
28Web Server
29 │
30 │ HTTP response
31 ▼
32Browser
33 │
34 ▼
35Web Page

Why Doesn't DNS Do This Every Time?

If your computer had to contact the root server, TLD server, and authoritative server every time you opened a website, browsing would be much slower.

This is why DNS caching is extremely important.

The answer can be cached at multiple levels:

1Browser
2 ↓
3Operating System
4 ↓
5Router
6 ↓
7DNS Resolver
8 ↓
9Authoritative DNS

Suppose the resolver recently looked up:

1example.com → 93.184.216.34

It can temporarily remember that answer.

The next user asking for the same domain may get the answer immediately.


What Is TTL?

DNS records have a value called TTL — Time To Live.

TTL tells caches how long they can keep a DNS answer.

For example:

1example.com
2IP: 93.184.216.34
3TTL: 300 seconds

This means a cache can normally use that answer for about 5 minutes before it needs to obtain a fresh answer.

A longer TTL means fewer DNS lookups, while a shorter TTL allows changes to propagate more quickly.


DNS Doesn't Only Store IP Addresses

DNS can store many different types of information.

Some common DNS records are:

A Record

Maps a domain to an IPv4 address.

1example.com → 93.184.216.34

AAAA Record

Maps a domain to an IPv6 address.

1example.com → 2001:db8::1

CNAME Record

Creates an alias for another domain.

1www.example.com → example.com

MX Record

Specifies which mail servers handle email for a domain.

1example.com → mail.example.com

TXT Record

Stores text information used for various purposes, including domain verification and email security mechanisms.

So DNS is much more than simply a database of domain names and IP addresses.


What Happens If DNS Doesn't Work?

Imagine you have a perfectly working internet connection.

Your web server is also working.

But DNS is broken.

You type:

1example.com

Your computer can't find the IP address.

So it doesn't know where to connect.

You might see errors such as:

1DNS_PROBE_FINISHED_NXDOMAIN

or:

1Server DNS address could not be found

This is why DNS is such an important part of the internet.

The server might be perfectly healthy, but if its domain cannot be resolved, users may still be unable to reach it using the domain name.


One Simple Way to Remember DNS

Think about finding a person in a huge city.

You know:

1Person: Alice

But you don't know where Alice lives.

You first ask an information desk:

"Where should I look?"

It points you to the correct neighborhood.

Then the neighborhood directory points you to the exact building.

Finally, the building directory gives you the exact apartment.

DNS works in a similar hierarchical way:

1Domain
2 │
3 ▼
4Root
5 │
6 ▼
7TLD (.com)
8 │
9 ▼
10Authoritative DNS
11 │
12 ▼
13IP Address

Each level helps narrow down where the answer can be found.


Conclusion

DNS is one of those technologies that most people use every day without noticing.

You type a name, but computers need an IP address.

DNS acts as the bridge between the two.

It uses a hierarchy of DNS servers, caching, and different types of records to translate human-friendly domain names into information computers can use.

So the next time you type:

1google.com

remember what is happening behind the scenes:

Domain name → DNS lookup → IP address → Server connection → Web page

That simple lookup is one of the fundamental building blocks that makes the internet easy for humans to use.