DNS

Basic knowledge of DNS

DNS is a fundamental element of the Internet that has an essential purpose. This infrastructure makes the usage of the Internet for humans simple and easy. So, let’s explain a little bit more about it!

DNS explained

The Domain Name System (DNS) holds an extensive database with all actual domain names and the IP addresses that correspond to them.

When you type a website’s domain name, it triggers a DNS resolution process. First, this domain name must be turned into a language that computers and machines recognize (IP addresses). That is crucial for performing effective connections between the machines. Once the requested domain name is linked with the needed IP address, it is transferred back to the browser of the user. In the following step, the website loads, and the user can explore it easily.

A long time ago, when the Domain Name System did not exist, users were required to enter the IP address rather than the simple domain name. That was a challenge! Therefore DNS was a great invention for making communication between machines and humans much easier.

The hierarchy

The domain namespace is created with a hierarchy structure on different levels and multiple DNS servers that are located worldwide. On the top above all is the root. The next level is for the top-level domains (TLDs). Below them are the secondary domains and subdomains.

Root level – From this level starts the search in the DNS resolution process. It is expressed with a dot “.” at the end of the domain name. Although, daily users don’t use it. The root gives information for the name servers for the domain’s TLD. 

TLD level – The top-level domains are all extensions you have viewed, like .com, .net, etc. The TLD name servers will answer which name servers store the data for the domain name you query.

Second level domain. Here is the name of the website that you require information for, except the TLD extension. For instance, Wikipedia, from wikipedia.org.

Subdomain level – This is the subpart in front of the domain name. It is separated by a dot (“.”). For instance, a blog subdomain is blog.example.com.

Understanding the DNS query 

Each DNS query follows several steps. Let’s examine what happens when you make a DNS query for example.com.

The first reply is from the root name server. It is on the highest level of the hierarchy of DNS. The root server receives your request and provides a response. Yet, the only thing it knows is the needed information for the level below of the tree – the TLD. Each level has a singular purpose: answer for one piece till you get the complete result. 

The next level is for the TLD name servers, competent for the domain extensions, such as .com, .net, etc. In addition, they provide data for the authoritative DNS server. In our case, the name servers are accountable for TLD .com. They know where the example is stored and point you to its name server.

The authoritative DNS server for the domain will give you a reply with the IP address (IPv4 or IPv6). 

Then you know the IP address, and you are able to visit the website. In addition, that information will be stored in the DNS cache if you want to visit that website again. Then your browser will skip the steps and open the website.

Suggested article: 3 Most Common DNS attack Types