This is the first article of the „What is a DNS?“ series in which we will tell you more about DNS and its main features. We will also explain that to find the IP address of a given domain in DNS we need to look for a very important DNS record „domain.name=IP address“. The web browser cannot discover this DNS record on its own, so it should use another application for this purpose.
What is a DNS?
DNS (Domain Name System) is a system by means of which domain names on the Internet are resolved into IP addresses. The visible part of the DNS system is represented by domains and they exist so that resources or services on the web are given names. Almost all Internet services use DNS as they include web services, email client services, file transfer services and others. Thanks to DNS we open websites in our browser by just typing the domain name. Without the DNS system we would enter the server IP address where the website is located, but not the domain name.
Why Domains are Resolved into IP Addresses?
Users actually do not need IP addresses to browse the web. It is much easier to write down and remember “www.superhosting.bg” instead of “184.108.40.206”.
But the IP address is needed by the browser to discover the server where the website is located and connect with it.
For two applications to be able to communicate on the Internet, one of them should know the IP address of the other. This is a main prerequisite for the client-server communication.
The DNS system is used as a virtual Index where all records “domain.name=IP address” are stored.
Everyone who needs to know the IP address of a certain domain will have to look up the DNS record “domain.name=IP address” in the DNS Index.
The DNS Index is required for the proper operation of all applications needing to connect with a server on the Internet, but having only a domain name available. The browser needs to know the IP address of the server where the files of mysupersite.com are located and the mail client needs to know the IP of the incoming mail server which we have specified for mail.mysupersite.com. The FTP client also wants to know the IP address of the FTP server which we have specified as a domain name ftp.mysupersite.com.
Where is the Record “domain.name=IP address” Located?
The record is located in one of the DNS system’s three main components:
The Domain Name Space is a specification for a tree structured name space associated with the domain names. Resource records are data associated with a specific domain name. Resource records are also called DNS records as they are stored in a text file called DNS zone file (or DNS zone). The important „domain.name=IP address“ record is a DNS record of A type. We will talk in more details about the DNS zone and DNS records in an upcoming article.
The name server stores the DNS zone for the specific domain name. The important DNS record „domain.name=IP address“ is available in a text file on a name server. The name server which stores the “authentic” DNS data for the domain is called authoritative name server. This name server is responsible for the DNS records of the respective domain! In this series of articles we will also call them authoritative servers to distinguish them from the DNS cache and the DNS resolver.
All other DNS servers on the Internet which normally reach the authoritative name server to get data for a certain domain are DNS resolvers.
The DNS resolver performs a DNS lookup in the DNS Index as it follows redirects from one level to another, from one authoritative name server to another, until it reaches the necessary DNS record.
The DNS resolver is an application most often located on a DNS server at the ISP. There might be also a DNS cache application which keeps data of the DNS lookups performed.
Computers and mobile phones usually have a default local DNS client installed with their operating systems, which is also called a stub-resolver. The web browser communicates with the local DNS client which normally turns for further actions to the DNS resolver of the ISP.
Query for the Domain IP Address
Finding the IP address requires that the client application asks specific questions in compliance with the DNS protocol. The web browser is not familiar with these questions, but with a very special one: “What is the IP address of this domain” as it also knows that the question should be asked to the local DNS client. An IP address is expected as a response.
Since the web browser is not prepared to perform DNS lookups into the DNS Index, it will connect to another application to discover the domain IP address. This is the local DNS client which will connect to the resolver on the DNS server at the ISP.
After the local resolver (DNS client) receives the browser query it will first look up in the DNS system cache and the hosts file if there is information about the domain. In case there isn’t, the resolver will send query to the DNS resolver.
The DNS Resolver will Discover the Domain’s IP Address
After the resolver gets a query for the domain IP address, it will initiate a lookup in the DNS Index.
The DNS resolver is an application which receives queries from DNS clients, questions one or more authoritative name servers in the DNS Index and gets to the client a response with the necessary information.
To be able to get back an IP address to the client, the DNS resolver will look for the DNS A record where the domain IP address is located (domain.name=IP address).
Here we still won’t use the DNS cache applications whose only purpose is to record the DNS lookup results so that during the next client query for the same data they can spare the same lookup for the resolver and authoritative name servers.
The text file where the A record is stored also contains all other DNS records for the same domain. The list of records is called a DNS zone.
To get to the authoritative name server where the domain DNS zone is stored, the DNS resolver will have to go through all levels of the DNS Index as each level will forward it to the next for finding the crucial information. The DNS lookup will start from the DNS root level.
The Domain Name System has been used on the Internet since 1985 which is about five years before the Web appeared. The first DNS implementation was meant to be used by UNIX and written by four students from the University of Berkeley. It is called The Berkeley Internet Name Domain – BIND. Nowadays BIND is the most common software for a DNS server which can be also used as a DNS resolver or authoritative name server.