Article 03 of 42Domain guide

DNS Records Explained: A, CNAME, MX, TXT & NS (Cheat Sheet)

Learn what A, CNAME, MX, TXT, and NS records do, with examples and a cheat sheet for common setups.

7 min read42 articles in the journal

When you log into your domain registrar account and open the DNS management dashboard, you are usually greeted by a grid of confusing abbreviations, dots, numbers, and symbols: A, AAAA, CNAME, MX, TXT, @, 3600, and cryptographic hashes. One accidental typo or misplaced value can take down your company website, stop incoming business emails, or break customer support integrations.

It is no surprise that many website owners view DNS records as intimidating technical jargon best left untouched. However, managing your DNS does not require a degree in network engineering. At its core, a DNS zone file is simply a structured list of instructions that tells the internet where to send web visitors, how to deliver email, and how to verify that you own your domain.

What is a DNS record?

A DNS record is an individual entry saved inside a domain zone file on an authoritative nameserver. If the Domain Name System is the global address book of the internet, individual DNS records are the specific routing entries telling computers how to handle requests for your domain.

Every standard DNS entry consists of four primary components:

  • Name (or Host): The specific domain or subdomain the record applies to. The symbol @ is standard shorthand for the root apex domain (such as example.com), while prefixes like www or mail apply to subdomains.
  • Type: The protocol identifier that defines what kind of data the record contains, such as A, CNAME, MX, or TXT.
  • Value (or Target): The destination data, which can be an IP address, a server hostname, or a verification text string.
  • TTL (Time to Live): The duration in seconds that recursive resolvers may cache the record locally before requesting an update from your authoritative server.

DNS records cheat sheet: quick reference table

Keep this reference table handy whenever you configure hosting, connect third-party apps, or set up company email:

TypeNamePrimary PurposeExample Value
AAddressMaps a hostname to an IPv4 numerical address192.0.2.1
AAAAIPv6 AddressMaps a hostname to a modern 128-bit IPv6 address2001:db8::1
CNAMECanonical NameAliases one hostname to another hostnameshops.myshopify.com
MXMail ExchangeRoutes incoming email to mail servers with priority10 mail.example.com
TXTTextHolds verification codes and email security policiesv=spf1 include:_spf.google.com ~all
NSNameserverIdentifies the authoritative nameservers for the zonens1.nameserverdns.com
SOAStart of AuthorityContains administrative metadata about the DNS zoneadmin.example.com 2026111201
PTRPointerMaps an IP address back to a hostname (reverse DNS)mail.example.com

A and AAAA records: pointing your domain to an IP address

The A record (short for Address record) is the foundation of web browsing. Its single responsibility is to connect a domain name or subdomain to a 32-bit IPv4 address. When a visitor navigates to your website, your A record directs their browser to the specific physical or virtual server hosting your web files.

The AAAA record (often pronounced "quad-A") does the identical job for IPv6 addresses. Because the internet ran out of unassigned IPv4 addresses years ago, global telecommunications networks transitioned to 128-bit IPv6 addresses, written as hexadecimal blocks like 2001:0db8:85a3:0000:0000:8a2e:0370:7334.

Configuring both an A record and an AAAA record is known as dual-stack networking. It ensures that visitors on modern mobile networks with native IPv6 support and users on traditional IPv4 connections connect to your website with equal speed and reliability.

CNAME records: pointing to another hostname

A CNAME (Canonical Name) record is an alias. Instead of mapping a domain name directly to a numerical IP address, it points one domain name to another domain name.

For example, you might create a CNAME record with Host www pointing to the value example.com. When a user requests www.example.com, DNS looks up the alias, finds that it points to example.com, and then queries the A record of example.com to retrieve the server IP.

CNAME records are common when connecting services like Shopify, Wix, HubSpot, or GitHub Pages, because those platforms manage their own dynamic IP addresses. However, CNAME records have one crucial rule: under standard DNS rules (RFC 1034), a CNAME cannot coexist with any other record for the same hostname. Because your root domain requires NS and SOA records, you cannot place a traditional CNAME record at your root apex (@). Doing so can break email delivery and domain routing.

MX records: email routing and priority explained

The MX (Mail Exchange) record tells sending email servers where to route incoming messages addressed to your domain (such as [email protected]). Without an MX record, external email servers have no way of knowing which mail system processes your inbox, causing messages to bounce.

Unlike web traffic records, MX records always include a numerical priority value alongside the mail server destination. This priority determines the order in which sending servers should attempt delivery:

  • Lower numbers mean higher priority: A mail server with priority 10 will always receive incoming traffic before a secondary server set to priority 20 or 30.
  • Backup redundancy: If your primary email server is temporarily down for maintenance, sending mail systems automatically fall back to your next lowest priority mail server.
  • Destination rules: MX records must always point to a valid domain hostname (such as aspmx.l.google.com), never directly to an IP address or an alias.

TXT records: domain verification, SPF, DKIM, and DMARC

Originally created simply to hold free-form notes, TXT (Text) records have become the primary mechanism for domain verification and email authentication on the modern web.

Today, you will use TXT records for several critical jobs:

Ownership Verification

Platforms like Google Search Console, Microsoft 365, or SSL authorities will ask you to publish a unique random token (such as google-site-verification=abc123xyz) to prove you control the domain before they activate services.

SPF (Sender Policy Framework)

An SPF record is a TXT entry starting with v=spf1 that explicitly lists which mail servers are permitted to send emails from your domain name. This prevents spammers from spoofing your address.

DKIM (DomainKeys Identified Mail)

DKIM publishes a public cryptographic key in a TXT record. When you send an email, your server signs it with a matching private key, proving to receiving inboxes that the message was not modified in transit.

DMARC (Domain-based Message Authentication)

A DMARC TXT record tells receiving servers what action to take (monitor, quarantine in spam, or reject completely) when an email fails both SPF and DKIM authentication checks.

NS records: who manages the zone?

NS (Nameserver) records define which authoritative DNS servers hold the master copy of all DNS records for your domain. When someone looks up your website, the global registry points them to the servers listed in your NS records.

When you register a domain or change your hosting company, you update these nameservers in your registrar settings. As detailed in our guide on what domain hosting is and how it powers your website, setting your NS records delegates complete technical control of your DNS zone to the provider running those nameservers.

Common DNS configuration mistakes to avoid

Even experienced web administrators occasionally make mistakes when editing DNS records. Keep an eye out for these frequent pitfalls:

  • Placing a CNAME at the root apex: Creating a CNAME record for @ violates DNS RFC standards and wipes out the visibility of your MX and NS records. If your web host requires apex pointing to a hostname, use an ALIAS or ANAME record supported by modern DNS providers instead.
  • Conflicting records on the same hostname: You cannot assign both an A record and a CNAME record to the same subdomain. Choose one target method.
  • Multiple SPF records: A domain must never have more than one TXT record containing v=spf1. Having multiple SPF records causes email authentication to fail. Combine all authorized sending services into a single SPF record string.
  • Forgetting MX records during site migrations: When switching web hosts, people often update their nameservers without copying existing MX records to the new host, causing all inbound business emails to fail silently.

How to view any domain's DNS records

Whenever you launch a website, adjust email providers, or verify domain security, you should confirm that your changes are visible across the public internet.

You do not need command-line terminal utilities to inspect zone files. With DomainRecon's free DNS Lookup Tool, you can check any domain in seconds.

The tool queries global authoritative nameservers and displays a clean breakdown of active A, AAAA, CNAME, MX, TXT, and NS records. This allows you to verify that your website points to the correct hosting server, confirm your email routing priorities, and check your security records before going live.

Frequently asked questions & conclusion

Can I have multiple A records for a single domain?

Yes. Setting multiple A records pointing to different server IP addresses is a standard technique called DNS round-robin. It distributes incoming visitor traffic across multiple web servers to balance server loads.

What happens if I delete my domain's MX records?

If you delete your MX records, external mail servers will have no destination address for emails sent to your domain. Incoming messages will fail to deliver and bounce back to the sender.

How many TXT records can I add to one domain?

You can add dozens of individual TXT records for domain verification, security tokens, and DKIM keys. The only strict limitation is that you must only maintain one SPF record per domain name.

Do I have to pay extra to create DNS records?

No. Creating, editing, and deleting DNS records is almost always included free of charge as part of your standard domain registration or web hosting account.

DNS records may look like an intimidating alphabet soup at first glance, but each record type has a clear, focused responsibility. A records connect visitors to your web server, CNAME records create flexible aliases, MX records direct incoming mail, TXT records prove ownership and protect your brand, and NS records determine who manages the zone. By mastering these basic record types, you gain full control over your domain infrastructure and eliminate the risk of accidental downtime.

Put this guide to work

Check a domain before you commit.

Free availability, WHOIS, DNS, SSL, subdomain, and email checks in one place.

Check availability