DNS

Updated on

By Gopal Hegde

Reviewed by Jatin Khosla

The Domain Name System. This stores all domain names and associated data.


What is DNS ?

DNS is a network protocol designed in 1987 used to resolve human-readable domain names (like `www.example.com`) into machine-readable IP addresses (such as `192.0.2.1` for IPv4 or `2001:db8::1` for IPv6), which are necessary for locating and identifying computer services and devices on the internet. The process of resolving names into IP addresses is known as DNS resolution.

Design Goals

DNS was designed with the following design goals

  1. Multi - tenancy 
  2. Fault tolerance
  3. Scalability
  4. Highly performant 

Key Components of the DNS

- Domain Namespace : The DNS namespace is organized in a tree-like structure. Domain names are formed by labels (pieces of the domain name separated by dots, such as `www` and `example` in `www.example.com`) that are hierarchical from right to left. For instance, `.com` is a top-level domain (TLD), `example.com` is a second-level domain, and `www.example.com` is a third-level domain or subdomain.

- DNS Zones : A DNS zone is an administrative space within the domain name space. It represents a portion of the domain namespace for which specific servers have the authority to resolve DNS queries. Zones are defined in a DNS database called a zone file, which contains DNS records.

- DNS Records: DNS records are stored in zone files and map domain names to IP addresses or provide other information. Common types of DNS records include A (Address Record) for IPv4 addresses, AAAA for IPv6 addresses, MX (Mail Exchange) for email servers, and NS (Name Server) for DNS servers responsible for a domain.

- Root Servers: At the apex of the DNS hierarchy are the root DNS servers. These servers do not resolve domain names themselves but are queried to find the DNS servers responsible for top-level domains (TLDs, like `.com`, `.net`, `.org`).

- TLD Servers: TLD servers are responsible for managing the second-level domains within their respective top-level domains. They can direct queries to the authoritative servers for specific domains.

- Authoritative DNS Servers: These servers hold the DNS records for their specific domains. They respond to queries with definitive answers for requests about domains within their zones.

Related terms