The Internet has become an integral part of our daily lives. The majority of business activities are conducted online. The Internet is a geographically distributed network, and most of us have no idea what goes on when we perform simple tasks such as typing a URL in a web browser and hitting Enter.
To truly appreciate the ease with which we can access information across the globe, we must understand what happens behind the scenes. To make the information we want accessible, a lot of algorithms and steps work in the background.
This article will introduce you to one of the integral parts of the Internet machinery – the Domain Name System (DNS).
A Brief Look into the Basics of the Internet’s Working
Through the Internet, you can access information and services hosted on web servers that may be located quite far away from you. Getting to a webpage is as simple as typing the URL in your browser (the name of the website). The World Wide Web (WWW) functions similarly to traditional mail in that you need the recipient’s address to send a letter or request. On the WWW, a URL is the address of a webpage you wish to access.
Although you may be able to provide the URL of the target page, the computer technology that runs the World Wide Web does not understand text addresses. It only understands numbers/binary digits. Instead of specifying a website name, you should actually specify an IP address (something like 127.84.1.1). Of course, each web page would have its own IP address. Essentially, this means memorizing tons of combinations of numbers.
It’s a human tendency to identify things by their names, most of us can’t memorize so many numbers. To make it easier for people to remember a webpage’s “name”, URLs were originally designed. And webpage name is where a DNS comes into the picture.
What is DNS?
The DNS serves as a bridge between human convenience and Internet technology, ensuring smooth operation of the entire network.
Let’s delve a little deeper.
DNS is a hierarchical and decentralized system of storing the addresses of computers, resources, and other Internet-connected services. In layman terms, DNS functions as a telephone book which lists the name and IP address of a website.
As mentioned above, an IP address is a unique number that allows computers to locate other web pages and other computers across the World Wide Web and to route communication to the proper host. You can access a website by typing in its IP address, but first you must know the IP address of the website. For example, did you know Google’s IP address is 172.217.12.46? Imagine typing that into your web browser every time you wish to look up something! Won’t that be a tad difficult? Now imagine having to memorize all these numbers for websites you access on a daily basis and you’ll agree that replacing IP addresses with easy names was probably the best idea.
Now when you enter a URL and hit Enter, your web browser sends a request to the nearest DNS server. It searches the Internet for the IP address you wish to visit from among the millions of existing IP addresses. The entire process is carried out with the help of several intermediate servers, including DNS Resolver, a Root Server, a TLD Server, and an Authoritative Server. The intermediate servers then send the information one by one back to the requesting DNS server, and the information is then sent to the user’s web browser.
Sounds like a complex process, right? However, it actually happens within milliseconds that pass so quickly you hardly notice. We have described each and every step of the process that we briefly summarized above in the next section.
Understanding the DNS Lookup Process
There are five steps in the process of finding a domain name. In some cases, it might be extended due to the non-functioning of some web servers or some alternative arrangements put in place. For example, if a particular Google web server is down for maintenance, it might redirect your request to another nearest Google server that has been assigned to serve your location.
Step One – User requests information
The process is always user-initiated and starts when you type a web address in your browser and wait for the browser to load the page. When you type a website name, the computer looks for the IP address associated with it in its local internet cache (every time you visit a website, the computer stores information related to it in its cache which also has the IP address of the server). If the computer has the IP address in the local cache, it starts loading the website. If it does not have the address in its local cache, it queries the nearest DNS resolver to find it. The DNS resolver figures out where the webpage you wish to see resides on the Internet.with the help of the Root Server, which receives the first request and lets the DNS resolver know the address of the TLD Domain (equivalent to the .com, .net, .in, .org, portion of the domain you entered) that contains the information about the site. Once the DNS resolver has all the information it needs, it sends the query to the Authoritative Name Server.
Step Two – Query is sent to Recursive DNS servers
When the request is forwarded from the resolver to the next level, it reaches your ISP’s DNS Server. Most ISPs have Recursive Domain Name Servers which are the middleman between your computer and Authoritative Name servers. If the recursive server has the IP address of the website, it transmits the information to your computer. If not, it forwards the request to the authoritative server.
Step Three – Query is forwarded to Authoritative Name server
The authoritative name server is at the bottom of the DNS lookup chain that responds to your query and finds the IP address. Once it finds the IP address of the website you originally requested, it sends the relevant DNS record (explained in the next section) to the recursive server.
Step Four – The DNS record is accessed
The recursive server receives the DNS record from the authoritative server and stores it in its local cache before sending it back as a result. This ensures that the next time any user requests to access the same website, it can forward the record stored in its local cache. There is, however, a time-to-live value associated with each DNS record. TTL determines how long a record is allowed to exist on the recursive server. The authoritative server decides the TTL for every domain name record it sends. TTL is generally expressed in seconds, so a record with a TTL of 3600 will survive an hour. It can, however, be reduced as time passes through routers and different servers. Once it elapses, the recursive server has to request a new DNS record for the website.
Step Five – The requested website is loaded
The recursive server finally sends the address record to your computer which is stored in the local cache. The browser reads the IP address of the website from the record and loads the website.
It’s no wonder everyone wants lightning-fast Internet access speed now that you realize how hard it is to type a website’s name in a web browser and hit Enter. But regardless of the number of steps involved, the entire DNS lookup process is completed within a few milliseconds, without you even noticing it!
And now let’s next understand the different kinds of DNS records that the Authoritative Name Server can fetch.
A quick look at the Different Types of DNS Record
Each domain has a set of DNS records that can be used to access the information showcased on it. DNS records are generally stored on authoritative servers, and contain the IP address of one of the servers where the website associated with the domain is hosted.
Here are some common DNS record types you will find:
A-Record
Also referred to as the Address Record, the A-Record contains the IP address of the domain. Whenever a domain is hosted on multiple servers, the A-Record will include at least one IP address from each server that serves that region.
CNAME Record
Also known as Canonical Name record, CNAME doesn’t contain the IP address of the domain, rather it forwards it to a different name. The CNAME record is used to redirect traffic to another domain when the first authoritative server in the chain doesn’t have the IP address of the requested domain.For example, if the user requests www.google.com and the authoritative server doesn’t have the IP address for the same, the request could be redirected to google.com without www.
TXT Record
The TXT record contains information about the relationship of the requested domain to other servers. It is used for verification purposes. TXT records aren’t just for websites; they are also a part of Sender Policy Frameworks in the Internet mail system. It is used to identify and confirm whether a message that has been received by your server is actually sent by it.
NS Record
The NS (Name Server) record determines which domain name server is authoritative for a particular domain. Domain server signifies which server in a chain of authoritative servers holds the IP address of the domain being requested. The NS record is generally found with ISPs, hosting companies, or registrars.
SOA Record
SOA (Start of Authority) records hold information of all the records for a given zone. The information it contains includes:
- Name of the primary domain name server
- Email address of the authority of the domain name zone
- A serial number of a secondary domain name server if the DNS information has changed.
To put it all together
DNS is the foundation of the Internet and every resource on the World Wide Web revolves around it. Similar to a postal system, it serves sender and receiver equally. Over the years, the number of websites and Internet services has increased significantly, which has required the IP address system to be updated to accommodate more sites. As such, the need for DNS servers has also increased a lot. However, not much has changed in the basic structure of how these servers work, which can be both a boon and a bane. Nevertheless, as technology improves, we might see upgrades to the system to make it more secure and efficient.