smartsub.co

Learn everything about the Tech World!

Tag Archive : DNS

DNS resolution: What happens when you access a website?

Thanks to DNS resolution, we don’t even think about what is happening when we click to visit a particular website. It is actually a complete process running behind the scene. It truly happens so fast, and because of it, we are not required to remember and type the difficult IP addresses. Instead, we memorize just the simple domain names, and we can easily connect to our favorite website. So, let’s explain a little bit more about this interesting process!

What does DNS resolution mean?

DNS resolution is a process that is triggered every time you want to connect to a website. After you type the domain name into your browser, it should be translated into machine understandable language. They communicate through numbers. For that reason, each domain name has to be translated into its corresponding IP address. 

In some cases, a domain could have only one IP address, but it could have several IP addresses in other cases. For instance, one of them could be IPv4 and the other one IPv6. The DNS resolution will request both of them. Yet, it is enough for the user to get just one of these addresses, and it will be able to reach the particular website.

Why do we need it?

The process of quick and easy translation becomes necessary long ago. Before the creation of DNS, each IP address was stored in a Host file, which was manually updated. Yet eventually, the devices that wanted to connect to the Internet increased into a higher number that it was not practical anymore to store the addresses that way.

So, the Domain Name System was developed, including the DNS resolution process. Thanks to it, the Internet nowadays is simple and easy to use. We are not required to remember the IP addresses but only the domain names. 

What is the process behind the DNS resolution?

There are several steps in which the DNS resolution is completed. It is initiated when a user desires to connect to a website, a domain name for the first time.

  1. You write a domain name inside the browser. That is how the DNS query is made. After that starts a process for searching the analogous IP address – DNS lookup.
  2. The DNS recursive server receives the query, and it checks if the IP address is still available in its cache memory. If it is the first time requesting that specific domain, the answer won’t be there. So, the DNS recursive server is going to look for the address in the rest of the servers – Root, TLD, and finally, the authoritative DNS server.
  3. The Root server is on the top of the DNS hierarchy, which is the first stop of the lookup. It gives information and directs to the responsible Top Level Domain (TLD) server, for instance, .com, .info, etc. 
  4. The TLD server is going to provide information about which is the responsible nameserver for that specific domain name.
  5. Next, the DNS recursive server can ask the authoritative DNS server for the IP address of the domain.
  6. After receiving the answer, the Recursive DNS server can return to your browser with the needed data to access the website. Moreover, it will keep the IP address in its cache memory if you want to explore the site later.
  7. Finally, the browser loads the website you have typed.

So, now you know what process stands behind the DNS resolution. An how fast it actually happens! 

What are the characteristics of an Authoritative DNS Server?

What is an Authoritative DNS server?

The Authoritative DNS server is an essential part of every DNS network. It stores all of the important DNS data, including the DNS records for a specific domain. That server could belong to a domain registrar or a DNS hosting provider. 

A lot of authoritative servers cover various areas. They also provide responses to the queries, but just for the DNS zones they are set up for.

Every Authoritative DNS server has two main purposes. The first one is to store and keep the database of one or several domain names and their analogous IP addresses. The second duty of this server is to supply the recursive DNS servers with answers such as the accurate IP address for each domain requested by a user. 

It is crucial to remember that the authoritative server does not cache the results of queries. The reason for that is because it operates with the original data that is stored straight in its system.

Types

  1. Primary DNS server (Master DNS server) – It holds the original zone file with all DNS records. The administrator of the DNS zone only makes adjustments to the DNS records here in the Master DNS server. Every Slave DNS server receives the updated data via a mechanism called a zone transfer.
  2. Secondary DNS server (Slave DNS server) – Every Slave DNS server is an actual copy of the Master DNS server. That means different servers are capable of providing an answer to the DNS queries. It is necessary to note that you can’t make any adjustment to the DNS records inside a Secondary DNS server. Yet, you are going to have added points of presence (PoPs) that could reply to queries of the DNS resolvers.

Authoritative DNS server vs. Recursive DNS server

The Authoritative DNS server contains the original source of the DNS data, including the DNS records. On the other hand, the Recursive DNS server could only provide a copy of the DNS data if it’s still accessible in its DNS cache. That depends on the time-to-live (TTL) value established for the various DNS records.   

In case the TTL has been expired, and the data is not available there, the Recursive DNS server is going to produce a whole new search through the Root server, TLD server, when eventually it reaches the Authoritative DNS server. There it is going to receive an answer with the required DNS records finally.

How to check the Authoritative DNS servers?

You can easily check your Authoritative DNS server by using the NSlookup command. It is a simple tool available on Linux, macOS, and Windows. The DNS lookup for the NS DNS records is going to show you all the nameservers for the domain.

First, you have to open the Terminal on Linux and macOS or the Command Prompt on Windows. Next, just write the following:  

nslookup -type=ns exampledomain.com

You are going to receive a list of all of the nameservers for that particular domain, plus their analogous IP addresses. Just make sure to replace “exampledomain.com” with the domain name you wish to check. In addition, you are able to check every nameserver separately. That way, you examine if they respond accurately.

DNS Record Types Cheat Sheet

In case you are just starting managing your DNS, these DNS record types are fundamental. So, let’s explain a little bit more about them.

SOA record

The acronym SOA stands for Start Of Authority, and it is essential to explain this record first. With it, you can show the origin of the authority DNS zone. This DNS record holds inside very important information about the DNS zone. It is a must-have if you want your DNS network to operate normally. The SOA record points to the primary DNS server. In addition, it stores information for the domain administrator and contact information. It also includes parameters such as the domain serial number and how often it should refresh. It is important to note that there should be just one SOA record for a particular DNS zone.

A and AAAA record

The A record is probably the most well-known of all DNS record types. The reason for that is simple, and it is in use in nearly every DNS system. The purpose of the A (address) record is to map a domain name to its corresponding IP address. Thanks to it, people are not obliged to memorize long and challenging numbers. However, the A record is applicable only when it comes to IPv4 addresses.

On the other hand, the AAAA record comes in handy when we want to map a domain name to an IPv6 address. However, compared to the A record, it is not so frequently used. With increasing the number of devices worldwide, eventually, the IPv6 address and the AAAA record are going to get more popular. 

MX record

The MX (Mail Exchanger) record is another one of the common and essential DNS record types. With it, you are able to point the email server responsible for receiving emails for your domain. It includes the domain name, which points to the hostname of the incoming mail server. Remember, it has to point to a hostname, not an IP address.

It is possible to set several MX records with different priorities and establish a backup in case of some difficulties. This DNS record type is crucial for you if you want to receive emails. 

CNAME record

The CNAME record indicates the actual, canonical domain name for the domain or subdomain. A popular way of implementing this DNS record type is for subdomains. That way, the administration of your DNS becomes easier. You only have to make a CNAME record for each of your subdomains and point it to the domain name. Then, every time you make any modifications to your domain, you don’t have to update the changes over for each subdomain.

PTR record

The PTR record is another fundamental DNS record, which is oftentimes called pointer record. It performs quite the opposite to the A record and it is used for backchecks. It points an IP address (IPv4 or IPv6) to a hostname. It is necessary because the rest of the servers worldwide might require proving that an IP address actually relates to a hostname before accepting a service, involving in communication, or some other action. Therefore, it is principally used a lot in the verification of the host.