Core DNS Record Types
A record (Address record): maps a hostname to an IPv4 address. This is the most fundamental DNS record — when you type google.com, a DNS A record returns the IPv4 address. AAAA record: maps a hostname to an IPv6 address (four times the bits of an A record — hence four A's).
CNAME (Canonical Name) record: creates an alias from one name to another. www.example.com can be a CNAME pointing to example.com. The client follows the CNAME chain until reaching an A or AAAA record. CNAMEs cannot point to IP addresses directly, and cannot coexist at the zone apex (the root domain itself).
MX (Mail Exchanger) record: specifies the mail server responsible for accepting email for a domain. Multiple MX records can exist with priority values — lower priority number = higher preference. When someone sends email to user@example.com, the sending server queries MX records to find where to deliver it.
PTR (Pointer) record: the reverse of an A record — maps an IP address to a hostname. Used for reverse DNS lookups (IP→hostname). PTR records live in the in-addr.arpa zone for IPv4 (or ip6.arpa for IPv6). Used by mail servers to verify sender legitimacy and in security tools.
NS (Name Server) record: identifies the authoritative name servers for a domain. Every domain must have at least two NS records for redundancy. SOA (Start of Authority) record: contains administrative information about the zone — primary name server, responsible person email, serial number, refresh/retry/expire timers, and minimum TTL.
Additional Record Types
TXT (Text) record: stores arbitrary text data. Modern uses: SPF (Sender Policy Framework) to prevent email spoofing, DKIM (DomainKeys Identified Mail) public keys, DMARC policies, and domain ownership verification for services like Google Workspace. SPF records in TXT format specify which servers are authorized to send email for a domain.
SRV (Service) record: specifies the location of services using a structured format including hostname, port, protocol, priority, and weight. Used by VoIP (SIP), Microsoft Active Directory (locating domain controllers), and other services that need to advertise their location in DNS.
TTL (Time to Live): controls how long DNS responses are cached by resolvers and clients. Short TTL = more DNS queries but faster propagation of changes. Long TTL = fewer queries but slower change propagation. During planned changes (migration, IP change), reduce TTL hours before the change to minimize caching delays.
DNS Hierarchy and Resolution
DNS resolution process: client queries local cache → local DNS resolver (ISP or corporate DNS server) → root nameservers → TLD nameservers (e.g., .com, .org) → authoritative nameserver for the domain → returns the record. This iterative process is transparent to users.
Recursive resolver: the DNS server (typically your ISP or Google 8.8.8.8) that does the full lookup on your behalf and caches results. Authoritative nameserver: the server that holds the actual DNS records for a zone — the final answer. Forwarder: a DNS server that forwards queries it cannot answer to another DNS server rather than querying root servers directly.