Chapters List
- A Mental Model for Networking
- How Data Travels Across the Internet
- Why Networking Uses Layers
- The OSI Model
- The TCP/IP Model
- IP Addresses
- Understanding DNS (Domain Name System)
- TCP vs UDP: Reliable vs Fast Communication
- Ports and Sockets: Connecting Network Traffic to Applications
- How the Web Works (HTTP/HTTPS)
- Routers and NAT: Connecting Local Networks to the Internet
- Modern Networking Systems
computer networking
Understanding DNS (Domain Name System)
Learn how DNS is used to translate domain names to IP addresses
Up to this point we’ve talked about how devices communicate across networks using protocols and layers. But there’s a practical question we haven’t answered yet:
How do we actually find the servers we want to communicate with?
When you type a website address like:
google.com
your computer somehow needs to figure out the IP address of the server hosting that website. Computers don’t use domain names internally — they use IP addresses such as:
142.250.190.14
So how does your device translate a human-friendly name like google.com into an IP address?
This is where DNS (Domain Name System) comes in.
DNS acts as the phonebook of the internet, translating domain names into IP addresses so computers can locate each other.
In this chapter we will explore:
- What DNS is and why it exists
- How DNS resolution works
- The hierarchy of DNS servers
- Common DNS record types
- Why DNS is essential to the internet
1. Why DNS Exists
Humans are good at remembering names, but computers communicate using numbers.
Imagine if every website had to be accessed like this:
[http://142.250.190.14](http://142.250.190.14)
[http://151.101.1.69](http://151.101.1.69)
[http://104.244.42.129](http://104.244.42.129)
This would be difficult to remember and impractical at scale.
Instead, we use domain names:
google.com
wikipedia.org
twitter.com
DNS provides the system that maps these names to IP addresses.
Without DNS, the internet would still function — but it would be extremely inconvenient for humans to use.
2. The Basic Idea of DNS Resolution
When you enter a domain name in your browser, several steps happen behind the scenes to translate that name into an IP address.
This process is called DNS resolution.
At a high level, the process looks like this:
- You enter a domain name into your browser.
- Your computer checks if it already knows the IP address.
- If not, it asks a DNS resolver.
- The resolver queries the DNS system.
- The correct IP address is returned.
- Your browser connects to the website’s server.
All of this typically happens in milliseconds.
3. DNS Hierarchy
DNS is not a single server. Instead, it is a distributed hierarchical system consisting of several types of servers.
Understanding this hierarchy helps explain how DNS scales to support the entire internet.
Root DNS Servers
At the very top of the DNS hierarchy are the root servers.
Root servers do not know the IP address of every website. Instead, they direct queries to the appropriate Top-Level Domain (TLD) servers.
For example, if you look up:
example.com
the root server will direct the request toward the .com TLD servers.
Top-Level Domain (TLD) Servers
TLD servers manage domains based on their top-level domain extension, such as:
.com
.org
.net
.edu
.gov
These servers know which authoritative name servers are responsible for specific domains.
For example:
example.com
The .com TLD server will respond with the location of the authoritative DNS server for example.com.
Authoritative Name Servers
Authoritative servers contain the actual DNS records for a domain.
These records specify:
- The IP address of the website
- Mail server locations
- Subdomain information
When the authoritative server receives a query, it returns the final answer.
For example:
example.com → 93.184.216.34
4. Recursive Resolvers
Most users never communicate directly with root or authoritative servers.
Instead, queries are handled by recursive resolvers, typically operated by:
- Internet Service Providers (ISPs)
- Public DNS services
- Corporate networks
Examples of public DNS resolvers include:
- Google DNS (8.8.8.8)
- Cloudflare DNS (1.1.1.1)
The resolver performs the entire lookup process on behalf of the client.
This greatly improves efficiency and reduces load on the DNS system.
5. DNS Caching
To improve performance, DNS responses are cached.
Caching allows systems to temporarily store DNS results so repeated queries can be answered faster.
DNS caching can occur in several places:
- Your browser
- Your operating system
- Your router
- Your ISP resolver
Each DNS record includes a TTL (Time To Live) value that determines how long it can be cached.
Example:
TTL = 3600 seconds
This means the record can be stored for 1 hour before it must be refreshed.
6. Common DNS Record Types
DNS stores information in structured entries called records.
Some of the most common record types include:
A Record
Maps a domain name to an IPv4 address.
Example:
example.com → 93.184.216.34
AAAA Record
Maps a domain name to an IPv6 address.
Example:
example.com → 2606:2800:220:1:248:1893:25c8:1946
CNAME Record
Creates an alias for another domain name.
Example:
[www.example.com](http://www.example.com) → example.com
MX Record
Specifies the mail servers responsible for handling email for a domain.
Example:
example.com → mail.example.com
TXT Record
Stores text-based information, often used for:
- Email verification
- Domain ownership verification
- Security policies (SPF, DKIM)
7. Why DNS Matters
DNS is one of the most critical components of the internet.
Without DNS:
- Websites would require memorizing IP addresses
- Internet services would be much harder to manage
- Large-scale infrastructure would become difficult to maintain
DNS enables the internet to be human-friendly while remaining technically scalable.
Key Takeaways
DNS is the naming system of the internet.
It translates domain names into IP addresses so devices can locate each other.
The DNS system works through a hierarchy of servers:
- Root servers
- TLD servers
- Authoritative name servers
Resolvers perform the lookup process and caching improves performance.
Together, these components allow billions of devices to find each other quickly and efficiently.
In the next chapter, we will explore how web communication actually happens once a server has been located.