DNS Records Explained — What A, CNAME, and TXT Records Actually Point To
"Configuring a domain" usually boils down to "adding a DNS record." Setting up a subdomain, improving email deliverability, proving ownership of a domain to some external service — the goals differ, but the actual task is often the same: add one line in a domain management panel. This post walks through three of the most common DNS record types — A, CNAME, and TXT — what each one actually points…
DNS records serve as the building blocks for translating human-friendly domain names into computer-friendly IP addresses. There are three primary record types: A, CNAME, and TXT. To illustrate, let's examine their functions through two real-world examples involving our domain.
An A record is the most fundamental type. It directly maps a hostname, such as wpmm.jp, to a specific IPv4 address. This creates a straightforward connection - traffic meant for the domain is routed to that particular IP. When launching a new web server, an A record is typically the first configuration step.
A CNAME record, on the other hand, treats one hostname as an alias for another. Instead of pointing directly at an IP, it indicates that the actual content resides elsewhere - at a different hostname. The key difference is that a CNAME record provides an indirect reference compared to the direct IP mapping an A record provides. However, there are limitations.
A CNAME record cannot be paired with other record types at the same time, like MX or TXT. It also cannot be placed at the domain apex (e.g., wpmm.jp without a subdomain). Instead, an A record is used in such scenarios.
TXT records are a bit different. They attach an arbitrary text string to a domain name rather than an IP or another hostname. Initially intended for human-readable notes, today they're almost exclusively used by machines for various purposes. Two common uses include proving domain ownership to external services through a random string confirmation and configuring email authentication protocols.
In one instance, we added a TXT record for _dmarc.wpmm.jp, which enabled DMARC email authentication. DMARC combines SPF and DKIM checks to determine how to handle emails that fail these checks, providing a policy response.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.