What is DNS?
Have you ever wondered what happens behind the scenes when you type in website name into your browser. How does computer knows from the name that you are requesting that specific website? The magic behind this is called Domain Name System, which you use on daily basis and might be unaware off.
DNS or Domain Name System translates domain names to their IP addresses so that browsers can load the requested website. Servers are computers storing HTML files, images, sounds, videos or any other file types.
DNS is like phone book of internet. Servers that work together to provide IP address of the requested website to the web browser are called DNS servers.
How DNS works?
The process of DNS resolution involves converting a hostname (such as www.example.com) into a computer-friendly IP address (such as 192.168.1.1). An IP address is given to each device on the Internet, and that address is necessary to find the appropriate Internet device – like a street address is used to find a particular home. When a user wants to load a webpage, a translation must occur between what a user types into their web browser (example.com) and the machine-friendly address necessary to locate the example.com webpage.
In order to understand the process behind the DNS resolution, it’s important to learn about the different hardware components a DNS query must pass between. For the web browser, the DNS lookup occurs “behind the scenes” and requires no interaction from the user’s computer apart from the initial request.
DNS resolver connects the web browser of our computer to the DNS name servers. There are 13 sets of root name servers, logically named as Letter.root-servers.net, where Letter ranges from ‘a’ to ‘m’, and are operated by 12 different organizations. Each set has a number of servers placed around the world. TLD name server stores the information of all domain names sharing a common domain extension. Authoritative name server is the last server in the Domain Name System. It stores the IP address of the requested website. When we purchase a domain name from a registrar, Registry updates the authoritative name server for the purchased domain in the TLD name server. So, when TLD name server receives a DNS query, it forwards DNS resolver to the correct authoritative name server. DNS servers eliminate the need for humans to memorize these complex IP addresses. The only thing we need to memorize is the domain names which are easier to remember.
Types of DNS Servers
There are 4 DNS servers involved in loading a webpage:
- DNS recursor – The recursor can be thought of as a librarian who is asked to go find a particular book somewhere in a library. The DNS recursor is a server designed to receive queries from client machines through applications such as web browsers. Typically the recursor is then responsible for making additional requests in order to satisfy the client’s DNS query.
- Root nameserver – The root server is the first step in translating (resolving) human readable host names into IP addresses. It can be thought of like an index in a library that points to different racks of books – typically it serves as a reference to other more specific locations.
- TLD nameserver – The top level domain server (TLD) can be thought of as a specific rack of books in a library. This nameserver is the next step in the search for a specific IP address, and it hosts the last portion of a hostname (In example.com, the TLD server is “com”).
- Authoritative nameserver – This final nameserver can be thought of as a dictionary on a rack of books, in which a specific name can be translated into its definition. The authoritative nameserver is the last stop in the nameserver query. If the authoritative name server has access to the requested record, it will return the IP address for the requested hostname back to the DNS Recursor (the librarian) that made the initial request.