Skip to main content

Command Palette

Search for a command to run...

DNS Record Types Explained

Published
2 min read

What is DNS?

DNS translates human-readable domain names to machine-readable IP addresses. When you enter a URL, your browser queries DNS servers to resolve the domain to its corresponding server location.

Core DNS Record Types

NS (Name Server) Records
Delegate DNS authority for a domain to specific nameservers (e.g., ns1.cloudflare.com). These servers host all other DNS records for the domain.

A Records
Map a domain or subdomain directly to an IPv4 address (e.g., example.com → 192.0.2.1).

AAAA Records
Serve the same function as A records but for IPv6 addresses (e.g., example.com → 2001:db8::1).

CNAME Records
Alias one domain name to another, not to an IP address (e.g., www.example.com example.com). Cannot coexist with other record types at the same hostname.

MX Records
Direct email for a domain to designated mail servers, with priority values for failover (e.g., 10 mail.example.com).

TXT Records
Store arbitrary text, commonly used for domain verification (Google Search Console), email security (SPF, DKIM, DMARC), and other service validations.

Practical DNS Configuration

A typical website setup involves:

  • NS records pointing to your DNS provider

  • A/AAAA records for the root domain (example.com)

  • CNAME records for common subdomains (www)

  • MX records for email routing

  • TXT records for service validations

All records work together: NS records delegate authority, A/AAAA provide server IPs, CNAMEs create aliases, MX routes email, and TXT handles verification.

DNS resolution occurs hierarchically: root servers → TLD servers → authoritative nameservers (specified by NS records) → final record lookup. This distributed system ensures reliable domain resolution globally.

More from this blog

Rohan Gupta's Blog

14 posts