DNS (Domain Name System) is a system that translates human-readable domain names (like www.example.com
) into IP addresses (like 192.0.2.1
) that computers use to identify each other on the network. It functions like a phone book for the internet, allowing users to access websites using easy-to-remember names instead of numerical addresses.
Domain Names: Structured hierarchically, consisting of levels separated by dots. For example, in www.example.com
, "com" is the top-level domain (TLD), "example" is the second-level domain, and "www" is a subdomain.
DNS Records: Information stored in DNS servers, including:
A Record: Maps a domain to an IPv4 address.
AAAA Record: Maps a domain to an IPv6 address.
CNAME Record: Alias of one domain to another.
DNS Servers:
Recursive Resolvers: Handle the initial request from the client and query other DNS servers to find the answer.
Root Name Servers: The top-level servers that direct queries to appropriate TLD servers.
TLD Name Servers: Manage the next level of the domain hierarchy (e.g., .com
, .org
).
Authoritative Name Servers: Provide the final answer for a specific domain.
A user enters a domain name in their browser.
The request is sent to a recursive resolver.
If the resolver doesn't have the answer cached, it queries the root name server.
The root server directs the resolver to a TLD server.
The TLD server points to the authoritative name server for the domain.
The authoritative name server provides the IP address, allowing the user's device to connect to the desired website.