DNS Records Explained: A, CNAME, MX, TXT, and More

Published: January 24, 2026 | Author: Editorial Team | Last Updated: January 24, 2026
Published on subdoms.com | January 24, 2026

DNS records are instructions stored in your domain's DNS zone that tell the internet how to handle traffic for your domain. Different record types serve different purposes — some point domain names to IP addresses, others route email, verify domain ownership, or define how other DNS servers should find your zone. Knowing which record type to create and why is essential for anyone managing domains, subdomains, email, or web applications. Misconfigured DNS records are among the most common causes of website downtime and email delivery failures.

A and AAAA Records: The Foundation of Name-to-IP Mapping

The A record is the most fundamental DNS record type. It maps a hostname — like www.example.com or api.example.com — to an IPv4 address. When a browser needs to connect to a website, the first thing it does is look up the A record for that hostname to get the server's IP address. An AAAA record does the same thing but maps to an IPv6 address, the newer addressing format that provides a vastly larger pool of available addresses. Most domains should have both A and AAAA records to support all clients. A records have a TTL (Time to Live) value specifying how many seconds DNS resolvers should cache the record before checking for updates — low TTLs allow faster DNS changes during migrations, while high TTLs reduce DNS query load.

CNAME Records: Hostname Aliases

A CNAME (Canonical Name) record creates an alias that points one hostname to another hostname rather than directly to an IP address. CNAME records are commonly used to point subdomains like www.example.com to a hosting provider's hostname (like mysite.netlify.app) so that when the hosting provider changes their IP addresses, your DNS does not need updating. They are also used to point custom domain names to CDN, email marketing, and third-party service endpoints. Important constraints: you cannot create a CNAME at the root domain apex (example.com itself, not www.example.com), and CNAME records cannot coexist with other record types at the same name. Many DNS providers offer ALIAS or ANAME records as root-domain alternatives to CNAME.

MX Records: Routing Email to the Right Server

MX (Mail Exchanger) records specify which mail server should receive email sent to addresses at your domain. Each MX record includes a priority number — lower numbers have higher priority. If your primary mail server is unavailable, the sending server will try the next-highest-priority MX record. When you sign up for Google Workspace, Microsoft 365, or any hosted email service, the first configuration step is always creating or updating your domain's MX records to point to that provider's mail servers. Missing or incorrect MX records are the most common reason email delivery fails completely. SPF, DKIM, and DMARC records — all stored as TXT records — work alongside MX records to authenticate your outgoing email and prevent spoofing.

TXT Records: Verification, Authentication, and Policies

TXT records store arbitrary text strings associated with a hostname and are used for a wide range of purposes that do not fit neatly into other record types. Domain ownership verification for Google Search Console, Bing Webmaster Tools, and SSL certificate authorities all work by having you add a specific TXT record that proves you control the DNS zone. SPF records, which list the servers authorized to send email from your domain, are TXT records. DKIM public keys, used to cryptographically sign outgoing email, are published as TXT records at a specific subdomain. DMARC policies, which tell receiving mail servers how to handle email that fails SPF or DKIM checks, are TXT records. As you add more services to your domain, your TXT record list grows — keep it documented so you know which records can safely be removed when you stop using a service. Visit SubDoms or contact us for DNS configuration assistance.

← Back to Home

Subscribe to Our Newsletter

Join 10,000+ subscribers. Get the latest updates, exclusive content, and expert insights delivered to your inbox weekly.

No spam. Unsubscribe anytime. We respect your privacy.