What is DNS?

What is DNS?

Ever asked yourself what happens when you type www.somewhatwebsite.com on Google? 

Or have you ever thought about the technology that lets you access such information in seconds? If you are like me, you didn't even consider something like that existed. DNS and  DNS hierarchy makes it possible for you or anyone to access information on the internet. 

In this article, we'll look at how this internet infrastructure works.

What is DNS?

DNS is a short form of a domain name system. 

Think of it as a phonebook of the internet or internet directory. When was the last time you remembered your friend's phone number? That's what the phone book and contacts on your phone number are for. You save the number in your phonebook and never have to remember the number again. 

DNS is a giant contact list of the internet that converts domain names into IP addresses. 

When you type the domain name ArthurPritt.com into a web browser, the DNS finds the IP address associated with ArthurPritt.com. The site's IP address is what direct device you have to get you the right information or destination of your query. 

When the DNS finds the right IP address, your browser takes the address and uses it to send information to CDN edge servers or origin servers. When this is done, you can now access information on the website.

In short:

A DNS translates domain names into IP addresses so your browser can reconnect you to the requested source. Every device you have today, both at home and work, has a unique IP address that other devices can identify.

A DNS server is a computer that stores IP addresses associated with a website's names. Picture this as a phone book that stores your friend's contact. A DNS server eliminates the need to memorize IP addresses (93.184.217.34) whenever you want to access or connect to a device. However, domain names like ArthurPritt.com are easy for someone to remember.

How Do DNS Work?

When you type a URL query on a web browser, the URL has to go through at least four servers to get you the correct IP addresses. The four servers work together to get the correct IP address associated with the website/URL that you typed.

  • Recursive DNS server- This is the first server your request makes a stop. The recursive name server is your internet service provider or local ISP. It gets your query and checks if it has any data on its server similar to the query. If it can't find the answer to your query, it will send further requests to a root DNS server.
  • The Root DNS server/Root name server- The root name server converts the site's name into IP addresses, and 13 independent organizations operate it. It will check to find the correct IP address of your query's Top Level DNS (TLD) server. The root DNS server is like a library that contains all the TLDs. Every website will have "." which points to the DNS root name servers at the top of the DNS hierarchy, where it can get information about the correct TLD server.
  • TLD (The Top Level Domain) nameserver will narrow your search to find the website's hostname, like .org, .edu, .com, and many more. A search for arthurpritt.com will be pointed to a .com TLD nameserver. One thousand banks of TLD name servers improve the handling of requests.
  • The Authoritative DNS server- This is the final destination your query makes. The server has specific IPS for domain names. Once it gets the query, it sends it back so the website can load. It will return an error if it doesn't have a record for a particular query.

Information is sent back to your web browser when the correct IP is found and the web page loads. Besides that, the recursive DNS server stores IP in its cache memory so that the next time you want to access the page, you'll get it more quickly. Most importantly, it won't have to go through the whole process again.

No alt text provided for this image


Types of DNS Queries

DNS lookup has three queries that can be combined to optimize the process of DNS resolution to reduce the distance traveled. Here they are:

  • Recursive query- Here, the DNS client requests the DNS recursive server to respond with either the requested resource or provide an error message when the resource is not found.
  • Iterative query- Here, the recursive query returns the best answer it can. If there's no match to the request, it will refer the client to a DNS server authoritative for low-level domain space. The DNS client will then request the referral IP address. This goes on until there's a timeout or error.
  • Non-Recursive Query- This occurs if the  DNS resolver client requests a DNS server for a record it has access to or the record in its cache. In most cases, DNS servers cache DNS records to prevent additional bandwidth consumption.

What is DNS Caching?

Catching is storing information in a temporary location to improve the performance and reliability of requests. 

DNS caching stores information close to the client. So when you make the same request next time, you access it, and additional queries can be avoided, thereby improving load time and reducing bandwidth/CPU consumption. 

DNS data is cashed in several locations in a set amount of time(Time To Live) TTL. Each time you visit the website, its address is temporarily stored in a database so you can access it later. A DNS cache is needed for faster response to DNS queries.

Browser DNS Caching

Most websites can cache a DNS record for a set amount of time. 

The closer DNS caching occurs to the browser. The fewer processing steps must be checked to the correct IP address when requesting a DNS record. The browser cache is the first location to be inspected.

Operating System (OS) Level DNS Catching

OS-level DNS caching is the last local stop before a DNS query leaves your machine. This type of query in your operating system is handled by "stub revolver" or DNS client. When a stub revolver gets a query, it first checks its cache to see if there's any record. 

If it does not find it, it sends the query (or DNS query) to an internet service provider (ISP) recursive DNS server. When the recursive name server gets the query, it also checks if it has a similar record within the server before sending the request to the root DNS server.

To view or add a comment, sign in

More articles by Arthur Pritt Ndubi

Insights from the community

Others also viewed

Explore topics