Introduction to Domain Name System (DNS)
Define the Domain Name System (DNS) as the Internet’s naming service that translates human-friendly domain names into machine-readable IP addresses. Explore the fundamental concepts of DNS infrastructure, including name servers, resource records, and the importance of caching and hierarchy for scalability.
We'll cover the following...
The origins of DNS
Mobile phones associate a unique number with each user. As contacts grow, we rely on a contact list rather than memory. Similarly, computers are identified by IP addresses (e.g., 104.18.2.119). Because humans cannot easily remember IP addresses for every website, we need a directory to map domain names (like educative.io) to IP addresses. The Domain Name System (DNS) serves as this phone book for the internet.
What is DNS?
The Domain Name System (DNS) is a naming service that maps human-friendly domain names to machine-readable IP addresses. This process is transparent to users. When you enter a domain name, the browser queries the DNS infrastructure to translate it into an IP address, then forwards the request to the destination server.
The following slides illustrate the high-level DNS workflow:
This resolution occurs in milliseconds, minimizing user delay. Browsers also cache frequently used mappings to further improve speed.
Important details
Key details about DNS infrastructure include:
Name servers: DNS is a distributed infrastructure, not a single server. The servers that respond to queries are called name servers.
Resource records: The DNS database stores mappings as resource records (RR). An RR is the smallest unit of information requested from name servers. It contains three key fields: type, name, and value.
Common Types of Resource Records
Type | Description | Name | Value | Example (Type, Name, Value) |
A | Provides the hostname to IP address mapping | Hostname | IP address | (A, relay1.main.educative.io,104.18.2.119) |
NS | Provides the hostname that is the authoritative DNS for a domain name | Domain name | Hostname | (NS, educative.io, dns.educative.io) |
CNAME | Provides the mapping from alias to canonical hostname | Hostname | Canonical name | (CNAME, educative.io, server1.primary.educative.io) |
MX | Provides the mapping of mail server from alias to canonical hostname | Hostname | Canonical name | (MX, mail.educative.io, mailserver1.backup.educative.io) |
Caching: DNS employs caching at multiple layers to reduce request latency and alleviate load on the global infrastructure.
Hierarchy: DNS name servers are organized hierarchically. This tree-like structure ensures scalability as the number of domains and query load increases.
We will explore the hierarchical structure and management of the DNS database in the next lesson.