Navratri Festive Offer: 50% Off Cloud Hosting + FREE Migration Get It Now!
The Domain Name System (DNS) is one of the key components of the Internet. It is sort of an analog phone book for websites, as it maps friendly domain names to computer-understandable IP numbers.
The following will be an unrestrictive explanation of how DNS functions, beginning with the fundamentals.
Let’s know what is DNS. The full form of DNS is a Domain Name System.
DHCP is a system, by which Domain names, (for instance, www. example.com) are translated into IP addresses, (like 192. 0. 2. 1). Without DNS, each internet user should remember an IP address, that belongs to the particular WWW site that he or she wants to open.
To understand how DNS works, you need to know its main parts:
1. Domain Names: Examples include the URLs we input into the browsers (e.g., www. google. com).
2. IP Addresses are numbers that are affixed to devices within a network and aid in their identification.
3. DNS Servers: Servers that contain the DNS database and reply to DNS requests.
4. DNS Records: Any and all information related to the domain names and IP number of the same.
5. DNS Resolver: A program located on your device that initiates the DNS lookup procedure
Now, let's walk through what happens when you type a web address into your browser:
Step 1: Request from Web Browser
The IP address of the domain "www.example.com" must be discovered by your computer when you type it into your browser.
Step 2: Check the Local DNS Cache
To determine if it has recently looked up this domain, your computer first looks through its own DNS cache. If found, it uses that IP address. If not, it moves to the next step.
Step 3: Query the Resolver
Your PC queries the DNS resolver hosted by your ISP. When you connect to the internet, this is often automatically configured.
Step 4: Resolver Checks Its Cache
The resolver checks its own cache. If it has the IP address, it returns it to your computer. If not, the process continues.
Step 5: Query Root Servers
If the resolver doesn't have the answer, it starts at the top of the DNS hierarchy by querying a root server.
Step 6: Query TLD Servers
The root server directs the resolver to the TLD server for .com (in our example)
Step 7: Query Authoritative Name Servers
The .com TLD server provides the resolver with the address of the authoritative name server, for example.com.
Step 8: Get the IP Address
The resolver queries the authoritative name server and finally gets the IP address for www.example.com.
Step 9: Return the Result
The resolver returns the IP address to your computer.
Step 10: Web Browser Requests the Web Page
Now that your computer has an IP address, your web browser can request a page from the web server at that address.
This entire process typically takes only milliseconds!
Types of DNS Queries
There are three types of DNS queries:
1. Recursive Query
2. Iterative Query
3. Non-Recursive Query
DNS servers store different types of records. Here are some common ones:
- A Record: Maps a domain name to an IPv4 address.
- AAAA Record: Provides an IPv6 address mapping for a domain name.
- CNAME Record: Generates an alias between two domains.
- MX Record: Specifies mail servers for the domain.
- TXT Record: Stores text information, often used for verification.
- NS Record: Specifies authoritative name servers for the domain.
To speed up the process and reduce load on DNS servers, DNS information is cached at various levels:
- Browser Cache: Your web browser keeps a small DNS cache.
- Operating System Cache: Your computer's operating system maintains a DNS cache.
- Resolver Cache: Your ISP's DNS resolver keeps a cache of recent lookups.
- Server Caches: The various DNS servers in the hierarchy also maintain caches.
Each DNS record has a Time to Live (TTL) value that determines how long it can be cached.
DNS was originally designed without much focus on security. Over time, several security measures have been added:
- DNS over HTTPS
The Domain Name System (DNS) is an essential component of the Internet's operation. It enables us to replace numeric IP addresses with memorable domain names. Even though the process is intricate, most people never see it because it happens so rapidly.
Gaining an understanding of DNS can help you diagnose issues with internet connections and recognize the complex processes that support the seamless operation of the Internet.
Let’s talk about the future, and make it happen!