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.
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.
Recommended by LinkedIn
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:
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.