DNS (Domain Name System) is the protocol that clients use to find the IP address of a server.
*I will explain the DNS role in below steps
User
↓
Web Browser
↓
Enter domain in search bar (e.g., example.com)
↓
Check local DNS cache
├─ If IP found → go to server
└─ If not found → ask DNS resolver
↓
DNS Resolver (ISP)
↓
Check root DNS servers
↓
Check TLD DNS servers (.com, .net, etc.)
↓
Check Authoritative DNS server (NS record)
↓
Get A / AAAA record (IP address)
↓
Return IP address to browser
↓
Browser connects to web server using IP
↓
Server sends back website data
↓
Browser renders website for user
DNS Records
There are something called DNS Records which tie the complete picture of how internet finds something.
- NS record : points to DNS server responsible
- A/AAAA record : Tells the IP address of the server
- CNAME record : It maps one domain name to another domain name instead of pointing directly to an IP address
- MX record : directs mails to the correct mail server
- TXT record : mainly used as external verification info
DNS Record Comparisons
CNAME vs A/AAAA
- A / AAAA Record: Points a domain directly to an IP address.
- CNAME Record: Points a domain to another domain name, which then resolves to an IP via an A/AAAA record.
- Use CNAME: When multiple subdomains share the same IP as the main domain (centralized management).
- Use A/AAAA: When the domain/subdomain has its own unique IP or for root/apex domains.
NS vs MX
- NS (Name Server) Record: Points to the DNS servers responsible for a domain. Controls all DNS records for that domain.
- MX (Mail Exchange) Record: Points to the server that handles emails for the domain.
- Key difference: NS = controls DNS, MX = handles emails.
Conclusion
DNS is the phonebook of the internet — it translates human-friendly domain names into IP addresses so browsers can find websites.
Top comments (0)