The Domain Network System (DNS) protocol helps Internet users and network devices discover websites using human-readable hostnames, instead of numeric IP addresses. Show The DNS process, simplified, works as follows:
History of DNSThe idea of mapping human-readable hostnames to numerical addresses originated in the 1970s, with ARPANET, the predecessor of the modern internet. The Stanford Research Institute (SRI) was responsible for maintaining a text file called hosts.txt that mapped hostnames to computer addresses on ARPANET. To add an entry to the hosts file, users would call SRI staff during business hours, and they would add the host and its associated numeric address manually to the file. In the 1980s it was understood that a centralized, manually updated host file was not a scalable approach. John Postel of the University of Southern California, whose team was responsible for the ARPANET Assigned Numbers List, assigned the task of creating an automated naming system to Paul Mockapetris. Mockapetris was supposed to find a compromise between five competing technical solutions, but instead he created his own solution, the Domain Name System. In 1984, four UC Berkeley students wrote the first DNS name server implementation for unix, and named it BIND. In the 1990s BIND was ported to Windows NT. To date, it is the world’s most widely used DNS software. In 1987 DNS was formalized in RFC 1035. DNS Protocol SpecificationThe Domain NamespaceThe DNS namespace governs public hostnames used on the Internet. The namespace is a tree structure, with each node in the tree having a textual label and zero or more DNS resource records (RR) describing the domain. The domain name consists of the label, together with the label of its parent nodes, separated by a dot (as in “example.com”). The domain namespace is divided into zones, and each zone is delegated to a specific legal entity for administration and management. Domain Name Syntax and FormatA domain name consists of one or more parts called labels, which are separated by dots. A label may contain up to 63 characters. The label at the extreme right is the top-level domain (TLD), and the next labels from right to left are lower down in the namespace hierarchy. Each label is known as a subdomain of the label above it. DNS allows up to 127 hierarchical levels. For example, “forum.support.example.com” represents a subdomain “forum” under the subdomain “support”, under the domain “example”, under the top level domain “.com”. Architecture of DNS Resolver and Name ServerThere are two key components that resolve DNS requests by clients: a DNS resolver and a DNS name server. DNS Resolver Also called a recursive resolver, this is a server designed to receive DNS queries from web browsers and other applications or network devices. It receives a hostname, and is responsible for tracking down the IP address for that hostname:
In reality, resolvers do not go through this entire process for every recursive query, because part of the journey, including DNS server addresses, may already be stored in local cache. Authoritative Name Server The authoritative name server is the last stop in a DNS query. It holds the DNS Master File for the DNS zone it manages, which contains the trusted, correct resource records for all domains in the zone. In some cases, the authoritative name server routes the DNS resolver to another name server that contains specific records for a subdomain, for example, support.example.com. If a CNAME or ALIAS record is used, the name server redirects the DNS resolver to another hostname, for which the requested hostname is an alias, and the DNS resolution process starts over. DNS Message FormatDNS communication occurs via two types of messages: queries and replies. Both DNS query format and reply format consist of the following sections:
DNS Transport ProtocolDNS uses the User Datagram Protocol (UDP) on port 53 to serve DNS queries. UDP is preferred because it is fast and has low overhead. A DNS query is a single UDP request from the DNS client followed by a single UDP reply from the server. If a DNS response is larger than 512 bytes, or if a DNS server is managing tasks like zone transfers (transferring DNS records from primary to secondary DNS server), the Transmission Control Protocol (TCP) is used instead of UDP, to enable data integrity checks. DNS Master Files (Zone Files)A DNS Master File is a text file stored on a DNS name server, which defines the DNS information for a single DNS zone. The file contains the following data:
DNS Resource RecordsResource Records are used to store hostnames, IP addresses and other information in DNS name servers. A record is made up of the following fields:
The most common DNS record types supported by the DNS protocol:
Next-Generation DNSDNS can be more than just a routing mechanism connecting hostnames with IPs. Advanced DNS solutions leverage the DNS infrastructure for new use cases:
These capabilities are made possible by next-generation managed DNS servers that are able to intelligently route and filter traffic. Learn more about NS1’s intelligent DNS platform and take DNS to the next level. |