11.12.2024

DNS Basics

General

This article describes DNS basics.

Domain Name System (DNS) is a distributed system to store and process domain zone information. It is mainly used to map IP addresses of network nodes to human-readable names. However, such mapping is not the only DNS function. It also handles different types of resource records and solves a variety of tasks such as redirecting between domain names, load balancing among hosts, and linking certain services (such as mail service) to domains:

 

DNS is one of modern Internet pillars since knowing IP address of a requested host is critical to receiving a response to any Internet request. However, IP addresses are numerical values like 1.23.45.67, which are not human-readable. In addition, the core principle of IP address assignment in a network is uniqueness. Moreover, IP address is not something permanent: it may change when a host or hosting service provider changes, etc. All the above factors make network navigation by IP addresses complicated for a human.

DNS converts a symbolic name requested by a client to an IP address(es) of a server(s) responsible for this domain zone. At early stage of the Internet, IP address conversion was based on the content of "hosts” file prepared in the centralized manner and automatically distributed to each computer in a network. However, with the Internet growth, the need for a new mechanism arose, and in 1983 Paul Mockapetris developed it - DNS.

Key DNS features:

Domain name hierarchy and delegation

Domain is a named branch in a name tree, including the node itself (for example, “.com” first-level domain) and its subordinate nodes (“example.com” second-level domain, “mail.example.com” third-level domain, etc.). To designate domain name hierarchy, the term level is used, specifying the node position in a tree. The less the level number, the higher the domain position in the tree.

 

 

Look at the zero-level domain "." (dot) also called a root domain. In practice, the dot is usually omitted (we type "example.com” instead of "example.com."); in other words, specifying a root domain is not mandatory for IP address resolution. Most client programs (such as web browsers, etc.) add a zero-level domain automatically without showing it to a user. A domain name without a zero-level domain is called a relative domain name, while the name ending up with a dot is called a Fully Qualified Domain Name, or FQDN.

Domain zone – a part of a hierarchical domain name tree (for example, ".ru"), which is fully transferred for service to a particular DNS server (or, more frequently, to several servers) for subsequent delegation of responsibility for this domain and all subordinate domains ("anyaddress.ru", "any.anyaddress.ru") to another party.

Delegation – transfer of responsibility for a specific branch of a domain name tree to another individual or organization. This procedure implements one of the core DNS principles – distributed record storage and request processing. During the delegation process, so-called glue NS records for a delegated child zone ("example.com"), pointing to DNS servers of a party accepting the domain (for example, to DNS servers of our company) are added to resource records of a parent zone (".ru"). Since then, all resource records of the "example.com” second-level domain and all its subdomains ("mail.example.com", etc.) are stored on DNS servers of this company, with parent zone ".ru" storing only NS records pointing to these servers.

DNS server – a host storing resource records and processing DNS queries. DNS server can autonomously resolve addresses within the zone it is responsible for ("example.com" in the above example) or redirect requests for “foreign” zones to higher-level servers.

DNS client – a set of software tools to interact with DNS. Periodically, the DNS server itself acts as a client.

Key types of resource records

Resource Record (RR) – an information storage and transmission unit in DNS, which includes the following elements (fields):

The most used resource record types are:

Recursive and non-recursive DNS queries

Recursion is a model of query processing by a DNS server, when it performs full search of information (including information about domains, which are not delegated to it) and accesses other DNS servers if necessary.

DNS queries from a client (server) to a server may be recursive or non-recursive. In the first case, a DNS server that received a query polls all nodes in descending order of zone levels until it receives positive response or information that the requested domain does not exist. In case of a non-recursive query, the server returns positive response if only the queried node is within the domain zone for which this server is responsible. Non-recursion may be due to both query type and prohibition to perform such queries at the level of a DNS server itself:

 

Caching is another important DNS feature. When, during a recursive query fulfillment, DNS server polls other nodes, it may temporarily cache information contained in responses it receives. In this case, a repeated domain query does not go beyond DNS server's cache. Maximum permissible caching time is specified in TTL field of a resource record.