DNS

Introduction

DNS (English Domain Name System, «the domain name system») — a computer distributed system for obtaining information about domains.

It is most often used to obtain the IP address by host name (of a computer or device), to obtain information about mail routing and/or service nodes for protocols in the domain (SRV record).

The distributed DNS database is maintained by means of a hierarchy of DNS servers interacting according to a specific protocol.

The basis of DNS is the idea of the hierarchical structure of a name and of zones. Every server responsible for a name can hand over responsibility for the further part of the domain to another server (from the administrative point of view — to another organisation or person), which makes it possible to place responsibility for the currency of information on the servers of various organisations (people) responsible only for «their own» part of the domain name.

Since 2010, means of checking the integrity of transmitted data, called DNS Security Extensions (DNSSEC), have been introduced into the DNS system. The transmitted data are not encrypted, but their authenticity is verified by cryptographic means. The DANE standard being introduced provides for the transmission by DNS means of reliable cryptographic information (certificates) used to establish secure and protected connections of the transport and application layers.

Key Characteristics of DNS

DNS has the following characteristics:

DNS is important for the operation of the Internet, since to connect to a node information about its IP address is needed, and for people it is easier to remember letter (usually meaningful) addresses than a sequence of digits of an IP address. In some cases this allows virtual servers, for example HTTP servers, to be used, distinguishing them by the request name. Initially the conversion between domain and IP addresses was performed using a special text file hosts, which was compiled centrally and automatically distributed to each of the machines in its local network. With the growth of the networks the need arose for an efficient, automated mechanism, and that is what DNS became.

DNS was developed by Paul Mockapetris in 1983; the original description of the mechanisms of operation is contained in RFC 882 and RFC 883. In 1987 the publication of RFC 1034 and RFC 1035 changed the DNS specification and cancelled RFC 882, RFC 883 and RFC 973 as obsolete.

Additional Features

Terminology and Principles of Operation

The key concepts of DNS are:

The DNS system contains a hierarchy of DNS servers corresponding to the hierarchy of zones. Each zone is maintained by at least one authoritative DNS server (from English authoritative), on which the information about the domain is located.

A name and an IP address are not identical — one IP address can have many names, which allows many websites to be maintained on one computer (this is called virtual hosting). The reverse is also true — one name can be mapped to many IP addresses: this allows load balancing to be created.

To increase the resilience of the system, many servers containing identical information are used, and the protocol has means allowing the information located on different servers to be kept in sync. There are 13 root servers; their addresses practically do not change.

The DNS protocol uses TCP or UDP port 53 to answer queries. Traditionally queries and responses are sent as a single UDP datagram. TCP is used when the size of the response data exceeds 512 bytes, and for AXFR queries.

Recursion

In DNS the term recursion denotes the algorithm of a DNS server's behaviour:

«to perform, on behalf of the client, a complete search for the required information in the whole DNS system, if necessary by querying other DNS servers»

A DNS query can be recursive — requiring a complete search — and non-recursive (or iterative) — not requiring a complete search.

Similarly, a DNS server can be recursive (able to perform a complete search) and non-recursive (not able to perform a complete search).

Some DNS server programs, for example BIND, can be configured so that the requests of some clients are performed recursively, and the requests of others — non-recursively.

When answering a non-recursive query, as well as when unable or forbidden to perform recursive queries, a DNS server either returns data about the zone for which it is responsible, or returns an error.

The settings of a non-recursive server, when the response gives the addresses of servers that possess a larger amount of information about the requested zone than the answering server (most often the addresses of the root servers), are incorrect, and such a server can be used to organise DoS attacks .

In the case of a recursive query, the DNS server queries the servers (in order of decreasing level of the zones in the name) until it finds the answer or discovers that the domain does not exist (in practice the search begins with the DNS servers closest to the one sought; if the information about them is in the cache and is not stale, the server may not query other DNS servers).

Let us consider the operation of the whole system using an example.

Suppose we have typed the address in the browser

ru.wikipedia.org.

The browser looks for a match of this address to an IP address in the hosts file. If the file does not contain a match, then the browser asks the DNS server:

«what is the IP address of ru.wikipedia.org»?

However, the DNS server may know nothing not only about the requested name, but even about the whole domain wikipedia.org.

In this case the server turns to the root server — for example, 198.41.0.4. This server reports —

«I have no information about this address, but I know that 204.74.112.1 is responsible for the zone org.»

Then the DNS server sends its query to 204.74.112.1, but that one answers

«I have no information about this server, but I know that 207.142.131.234 is responsible for the zone wikipedia.org.»

Finally the same query is sent to a third DNS server and receives an answer — the IP address, which is passed on to the client — the browser.

In this case, when resolving the name, that is, in the process of looking up the IP by name:

Sometimes it is allowed for the queried server to pass the recursive query to a «higher-level» DNS server and wait for a ready answer.

With recursive processing of queries all the answers pass through the DNS server, and it gets the opportunity to cache them. A repeated query for the same names usually does not go beyond the server's cache; no access to other servers occurs at all. The permissible time for storing answers in the cache comes together with the answers (the TTL field of the resource record).

Recursive queries require more resources from the server (and create more traffic), so they are usually accepted from nodes «known» to the owner of the server (for example, a provider allows only its own clients to make recursive queries; in a corporate network recursive queries are accepted only from the local segment). Non-recursive queries are usually accepted from all nodes of the network (and a substantive answer is given only to queries about the zone hosted on the node; to a DNS query about other zones the addresses of other servers are usually returned).

Reverse DNS Lookup

Reverse DNS lookup (English reverse DNS lookup) — an access to a special domain zone in order to determine the name of a node by its IP address with the help of a PTR record.

To perform the query the address of the node is converted into reverse notation; the way of conversion depends on the IP version:

the IPv4 address 192.168.0.1 turns into 1.0.168.192.in-addr.arpa.;
the IPv6 address 2001:db8::567:89ab — into b.a.9.8.7.6.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa.

Thanks to the hierarchical model of name management, it becomes possible to delegate the management of the zone to the owner of the IP address range. For this, the records of the authoritative DNS server indicate that a separate server is responsible for the zone CCC.BBB.AAA.in-addr.arpa (that is, for the network AAA.BBB.CCC.000/24).

The number of PTR records describing different names for one address is not limited by the specifications, but may be limited by the size of the UDP packet, since the DNS server encapsulates its answer in UDP. In most cases only one PTR record is created for one IP address, but it also happens that many are created — for example, when the IP address is used for several virtual servers with different names.

Performing a Reverse Query

On query the «PTR» record is read, containing the domain name sought. If the record is absent or the corresponding subdomain is not delegated, then the IP address is considered to have no reverse DNS record.

PTR records do not require any special processing; these are simple records, similar to CNAME, which define aliases.

in-addr.arpa

The DNS record in-addr.arpa looks like this:

56.34.12.10.in-addr.arpa. IN PTR host1.example.net.

This will mean that the IP address 10.12.34.56 corresponds to the node name host1.example.net.

The DNS record ip6.arpa looks like this:

5.4.3.2.1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.8.b.d.0.1.0.0.2.ip6.arpa. IN PTR host1.example.net.

This will mean that the IPv6 address 2001:0db8::1:2345 corresponds to the node name host1.example.net.

When classless addressing is used, a problem arises with delegating individual subnets whose size does not coincide with the class (that is, with a subdomain of the next level).

To solve this problem RFC 2317 was created, describing the delegation of in-addr.arpa subdomains in classless addressing.

To delegate IPv6 address ranges, the domain zone ip6.arpa is used.

Related Articles:

Article author: Andrei Olegovich

Additional materials
Articles from Other Sites
Domain Delegation
Domain Registration
Domain Renewal
Domains. General Questions and Definitions