[TOC]
The Domain Name System(DNS) is a hierarchical and distributed naming system that translates human-readable domain names into IP addresses, enabling users to access websites easily.
The DNS process can be broken down into several steps:
- User Input
- Local Cache Check
- DNS Resolver Query
- Root DNS Server
- TLD Server
- Authoritative DNS Server
- Final Response
DNS operates through a hierarchical structure, ensuring scalability and reliability across the global internet infrastructure.
DNS helps manage a wide variety of domain types to organize the vast number of websites on the internet:
-
Generic Domains (gTLDs)
These domains are used for general purposes and are not tied to any country.
-
Country Code Domains (ccTLDs)
These domains represent specific countries or geographic regions.
-
Inverse Domains
These domains are used to map IP addresses back to domain names.
The client machine sends a request to the local name server, which, if the root does not find the address in its database, sends a request to the root name server, which, in turn, will route the query to a top-level domain(TLD) or authoritative name server.
DNS Lookup, also called DNS Resolution, is the process of translating a human-readable domain name into its corresponding IP address. The process involves:
-
DNS Resolver
Starts the DNS lookup process and acts as an intermediary between client and DNS servers.
-
Recursive Query
A query where the resolver fetches the complete answer on behalf of the client.
-
Iterative Query
A query where the server provides the best information it has or a referral.
-
Non-Recursive Query
A query where the answer is already available in cache or authoritative server.
Reverse DNS Lookup is the process of mapping an IP address back to its corresponding domain name. This is teh ooopsite of teh typical DNS lookup, where a domain name is resolved to an IP address. Reverse DNS is commonly used for:
- Network Diagnostics
- Email Security
DNS records are essential for defining how domain names are used and how services are configured. Here are some of the most commonly used DNS record types:
- A Record
- CNAME Record
- MX Record
- TXT Record
DNS caching is a temporary storage system that keeps records of recent domain name lookups like google.com <-> 172.217.0.46, to speed up future requests. Instead of querying a DNS server every time you visit a website, your computer or network checks the cache first, reducing load times and improving efficiency.
-
First Request
When you visit a website (e.g., example.com), your system queries a DNS server for its IP address.
-
Cache Storage
The IP address is saved locally—on your device, router, or ISP’s servers—for a set duration defined by TTL (Time to Live).
-
Subsequent Requests
Future visits to example.com use the cached IP, skipping the DNS lookup and making the connection faster.
DNS caching occurs at multiple levels, forming a hierarchical structure that optimizes performance.
- Browser-Level DNS Caching
- Operating System(OS) - Level DNS Caching
- Router-Level DNS Caching
- DNS Resolver (ISP/Third-Party DNS Server) Caching
- Recursive Resolver Caching
- Authoritative DNS Server Caching
- Content Delivery Network(CDN) Caching
- Host File Caching
DNS caching occurs at different layers in the system to improve performance and reduce repeated DNS lookups.
-
Router-Level DNS Caching
Routers cache DNS queries locally for connected devices, reducing external DNS requests and improving network efficiency.
-
DNS Resolver (ISP/Third-Party) Caching
DNS resolvers cache responses for multiple users, reducing the need to query authoritative servers repeatedly and improving resolution speed.
-
Content Delivery Network (CDN) Caching
CDNs cache content and help route users to the nearest server, reducing latency and improving load times.
-
Host File Caching
The hosts file acts as a manual override, allowing systems to resolve domain names before making any DNS query.
Time to Live dictates how long a DNS record should be stored in the cache memory before it is considered outdated and must be discarded or refreshed. TTL is measured in seconds.
The usage of TTL in computing applications lies in the performance improvement and management of data caching. It also finds its use in Content Delivery Network(CDN) caching and Domain Name System (DNS) caching.
Importance of TTL in DNS Caching:
- It reduces the time taken for DNS lookups.
- It ensures timely updates to DNS records.
- It prevents outdated data issues while maintaining speed.
- Browser-level DNS Cache Flush
- Operating System-Level DNS Cache Flush
- Set Appropriate TTL Values.
- Regular Cache Flushing.
- Use Reliable DNS Servers.
[3] EP143: DNS Record Types You Should Know
[4] How DNS Works
[5] DNS Caching














