What is the Domain Name System (DNS)?
Table of content
Can you imagine the world without the Internet?
Fortunatelly, we shouldn't have to answer that question.
This question only reminds us of how important is the relationship between the individual computers and the servers that build the world-wide web.
Undoubtedly, one of the main building blocks of the modern electronic communications is the Domain Name System (DNS). The Domain Name System (DNS) is a translation tool that allow us to translate hostnames into IP addresses just like a phonebook, where you can find a name and its corresponding phone number.
But all the similarities with the phone book end here.
In this article, we are going to show you a simplified example of how DNS works and what happens when a user decides to load a web page into computer's browser.
In order to make our example as clear and easy to understand as possible, we will spare you all unnecessary technological and statistical details and we will present the complicated protocol driven data in the form of simple conversation.
How does the DNS system work?
After entering the domain name (in the example we will use
www.example.com) in the browser and clicking the Enter button, the browser sends a query to the operating system - "Do you know the IP address of
The operating system checks if there is a record for this domain in the cache (temporary memory), and when it does not find any it responds to the browser - "I do not know the IP address but I know whom to ask."
Then the operating system sends a query to the resolving name server.
This kind of server resides in the Internet provider's network and stores in its cache the IP addresses of all sites that have been visited from this Internet Network for a certain period of time.
For the purpose of our article to continue in the right direction the resolving name server checks in its cache memory and does not find any information about the queried IP address.
One of the features of this resolving name server is when there is no cached information about the queried IP address to start a specific procedure for obtaining the IP address from an authorized sources.
Following this procedure, it sends a request to the root servers - "Do you know the IP address of
Root Servers - "No, but we know whom you need to ask - Top Level Domain (TLD) name servers that are responsible for
The resolving name server is asking TLD name servers the same question - "Do you know the IP address of
www.example.com" and gets the answer: "No, but we know which name servers you should ask - the authoritative nameservers."
The next request is sent to the authoritative name servers - "Do you know the IP address of
www.example.com" and the answer is "Yes,
www.example.com corresponds to IP address
The resolving name server saves the response in its cache and returns the IP address to the operating system. Then the operating system stores it in its own cache and sends the IP address to the browser.
Now the browser can send HTTP request to the web server and following the appropriate protocol to load the web page.
Our story may leave you under impression that DNS resolving process is too complicated and slow - in fact, obtaining the IP address even without the availability of cached entries takes only a few milliseconds.
The DNS caching further speeds up the loading of web pages while at the same time drastically reduces the numbers of requests to root servers and lower-level DNS servers.
Does the process described above have a practical meaning for the mass internet user - definitely yes.
The relationship between domain names and IP addresses
When you purchase a domain name, it gets registered in the database of the relevant TLD servers with name servers that keep all the domain information - DNS records, time-to-live (TTL), subdomains, etc.
In the domain control panel (each registered domain has a control panel), you have the ability to change these authoritative nameservers when it's needed - when you buy a new hosting plan, for example.
In order to configure the domain properly and to load the web site from the new server, you must enter the hosting's name servers as new name servers in the domain control panel - just delete the old entries, carefully copy/paste the new ones in their place, and press the Save button.
Another feature of the DNS system is the caching time of DNS information - many users have had not so nice experience when changing the A record of their domain name or changing the hosting provider.
The name servers have been changed correctly, the file transfer have been made correctly, but yet the site is not loading from the new server and the requests are still going to the old one. Why?
Because storing the domain DNS information in the cache of the recursive DNS resolver lasts for a certain amount of time.
This time is governed by the TTL (time-to-live) parameter and is usually within the range of 0 - 48 hours (however these values are not obligatory, but depend on the decision of server administrator).
A new procedure for refreshing the available records starts automatically as soon as the TTL period expires. From this moment on the site will be loading from the new server.
The information in this article will be of great help to you when you change your domain name servers as now you know about DNS caching and the need to wait for the old DNS records to get refreshed.
This knowledge will save you time in the management of your domain name as well as doubts about the quality of the hosting service.
In another article named DNS Terminology Briefly, we provide you brief definitions of the most commonly used DNS terms.