DNS (Domain Name System) is a distributed naming system that translates human-readable domain names into IP addresses, allowing computers to locate each other on the Internet. When you type a domain name (eg www.example.com) into your browser, DNS translates it into the corresponding IP address, allowing your device to connect to the desired server..
Let's delve deeper into the process of how DNS works:
- You type www.example.com into your browser.
- Your computer asks the DNS resolver for the IP address of www.example.com.
- If the resolver doesn't have the information, it goes through the following steps:
- The authoritative DNS server shares the IP address with the resolver.
- The resolver stores this information in its cache for future use, speeding up the process if you request www.example.com again soon.
a. Root DNS Server: The resolver contacts the root DNS servers to find out who controls the ".com" part of the address.
b. TLD Server (.com): The root DNS server points the resolver to the TLD server responsible for ".com.", The TLD server knows which authoritative DNS server is in charge of "example.com."
c. Authoritative DNS Server (example.com): The TLD server directs the resolver to the specific authoritative DNS server for "example.com.", The authoritative DNS server holds the exact IP address for www.example.com.
DNS records are essentially data entries within the DNS database, each serving a specific purpose. Common types of DNS records include
- A (Address) Record: Associates a domain name with an IPv4 address.
- AAAA (IPv6 Address) Record: Similar to A record but associates a domain name with an IPv6 address.
- CNAME (Canonical Name) Record: Alias of one domain to another. It is often used to map subdomains to the main domain.
- MX (Mail Exchange) Record: Specifies mail servers responsible for receiving emails on behalf of the domain.
- PTR (Pointer) Record: Used for reverse DNS lookups, mapping an IP address to a domain name.
- TXT (Text) Record: Allows domain owners to attach arbitrary text to a domain. It is often used for verification purposes, such as SPF (Sender Policy Framework) records.
- NS (Name Server) Record: Indicates which DNS server is authoritative for a particular domain.
Summary :
- DNS translates human-readable domain names into IP addresses for Internet communication.
- When you type a domain like www.example.com, DNS converts it to an IP address, facilitating device-server connections.
- DNS resolution involves querying a DNS resolver and, if needed, Root DNS, TLD Server, and Authoritative DNS Server.
- DNS records (A, AAAA, CNAME, MX, PTR, TXT, NS) play distinct roles in the DNS database.