DNS stands for Domain Name System its used to resolve human-readable hostnames like HostYuppie.com into machine-readable IP addresses like 18.104.22.168. DNS also provides other information about domain names, such as email services.
So why is DNS important? How does it work? What’s the whole handshake process?
Why is DNS important?
DNS is like a phone book for the Internet using assigned IP addresses to specific domain names or shared host. Domain names are easier to remember then the IP address. DNS provides this same service to the Internet as a phone directory does to store peoples name with their phone number.
When you visit https://www.hostyuppie.com in a browser, like Firefox, Microsoft Edge or Internet Explorer your computer uses DNS to retrieve the website’s IP address automatically. Without DNS, you would only be able to visit the website using the IP address directly, such as http://22.214.171.124
So as you see DNS makes the internet simpler by allowing users to use specific domain names like msn.com
How does DNS work?
When you visit hostyuppie.com, your computer starts to resolve the human-readable web address into a machine-readable IP address. This happens every time you use a domain name, whether you are viewing websites, sending email.
Step 1: Request information
It all starts when a user’s computer starts to resolve a domain name, such as visiting https://www.hostyuppie.com. The first step your computers browser will do is look for a local DNS cache, which stores information that your computer has recently retrieved. If your computer doesn’t already know the answer, it needs to perform a DNS query to allocate the DNS records.
Step 2: Ask the recursive DNS servers
If the information is not stored locally, your computer then sends a request to your ISP’s recursive DNS servers. These specialized computers perform the legwork of a DNS query on your behalf. Recursive servers have their own caches, so the process usually ends here if there is a stored record and the information is returned to the users browser for processing. If the ISP’s recursive DNS servers done have the record and then gets requested from the root nameservers.
Step 3: Ask the root nameservers
If the recursive servers don’t have the record, they query to the root nameservers is performed. A nameserver is a computer that answers questions about domain names, such as the IP addresses associated with the domain name being queried by the users browser. The thirteen root nameservers act as a kind of telephone directory as mentioned above and work like a switchboard for DNS. They don’t know the answer, but they can direct our query to someone that knows where to find it. Like moving to the TLD nameservers.
Step 4: Ask the TLD nameservers
The root nameservers will look at the first part of our request, reading from right to left hostyuppie.com and direct our query to the Top-Level Domain (TLD) nameservers for .com. Each TLD, such as .com, .org, net and .ca, have their own set of nameservers, which have their own TLD nameservers per domain name prefix. If these servers don’t have the record of information we need, they will refer us directly to the servers that do have the information.
Step 5: Ask the authoritative DNS servers
The TLD nameservers review the next part of our request for hostyuppie.com and direct our query to the nameservers responsible for this specific domain name record. These authoritative nameservers are responsible for knowing all the information about a specific domain, which are stored in individual DNS records. There are many types of records, each record contains different information related to a domain name. In this example, we want to know the IP address for hostyuppie.com, so we ask the authoritative nameserver for the Address Record (A).
Step 6: Retrieve the record
The recursive server retrieves the A record for hostyuppie.com from the authoritative nameservers and stores the record in its local cache. If anyone else requests the host record for hostyuppie.com, the recursive servers will already have the answer and will not need to go through the lookup process again.
The same process is used for a whois lookup record of a domain name
All records have a cached time value, and after the cached expiration date, the recursive server will need to ask for a new copy of the record to make sure the information doesn’t become out-of-date or no changes have been made to the domain name or DNS records and if so an update of the record will be performed.
Step 7: Receive the answer
The recursive server returns the A record back to your computers browser. Your computer stores the record in its cache, reads the IP address from the cached record, and then passes this information to your browser. The browser then opens a connection to the webserver and starts the process of loading the website from the web host/server.