SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
NetworkingJune 12, 20264 min read

DNS records explained: A, AAAA, MX, TXT, CNAME, NS

DNS is the internet's address book. Here's a plain-English guide to the record types you'll actually use — A, AAAA, CNAME, MX, TXT and NS — and when to reach for each.

NBy Nxeon Team

DNS — the Domain Name System — is the internet's address book. It turns human-friendly names like example.com into the numbers and instructions computers need to actually connect. A domain's DNS is made of individual records, each a small entry that answers one kind of question. Learn the handful of record types below and you'll understand almost every DNS setup you'll ever touch.

The anatomy of a DNS record

Every record has a name (the host it applies to, like www or @ for the root), a type (A, MX, and so on), a value (what it points to), and a TTL — Time To Live, the number of seconds resolvers may cache it. A low TTL (300s) means changes propagate fast; a high TTL (86400s) means less lookup traffic but slower updates.

A record — name to IPv4

The workhorse. An A record maps a hostname to an IPv4 address.

example.com.    A    203.0.113.10

This is what you set to point a domain at your server. When someone visits example.com, DNS returns 203.0.113.10 and the browser connects there.

AAAA record — name to IPv6

Identical in purpose to an A record, but for an IPv6 address (the newer, much larger address space).

example.com.    AAAA    2001:db8::10

If your server has an IPv6 address, add an AAAA record alongside the A record so IPv6-capable clients can reach it directly.

CNAME record — an alias to another name

A CNAME points one name at *another name* rather than an IP.

www.example.com.    CNAME    example.com.

Now www follows wherever example.com points. CNAMEs are perfect for pointing subdomains at a platform's hostname (e.g. a CDN or app host). Two rules to remember: a CNAME can't coexist with other records on the same name, and you can't put a CNAME on the root domain (example.com itself) — use an A record or your provider's flattening feature there.

MX record — where email goes

An MX (Mail Exchange) record tells the world which servers accept email for the domain. Each has a priority number; lower numbers are tried first.

example.com.    MX    10    mail.example.com.
example.com.    MX    20    backup-mail.example.com.

Crucially, MX records point to a hostname, not an IP, and they're completely independent of your website's A record. You can host your site on one server and your email on another (like Google Workspace or a mail provider) with no conflict.

TXT record — free-form text (and a lot of email security)

A TXT record holds arbitrary text. In practice it's the home of email authentication and domain verification:

  • SPF — lists which servers may send mail for your domain: v=spf1 include:_spf.example.com ~all
  • DKIM — publishes the public key that signs your outgoing mail.
  • DMARC — tells receivers what to do with mail that fails SPF/DKIM: v=DMARC1; p=quarantine; rua=...
  • Verification — Google, Microsoft and others ask you to add a TXT record to prove you own the domain.

Get SPF, DKIM and DMARC right and your mail lands in inboxes; get them wrong and it lands in spam.

NS record — who runs this domain's DNS

NS (Name Server) records delegate the domain to the DNS servers that hold its records.

example.com.    NS    ns1.provider.com.
example.com.    NS    ns2.provider.com.

These are set both at your registrar (pointing to your DNS provider) and within the zone itself. If your NS records point to the wrong provider, none of your other records take effect — always check these first when a whole domain seems broken.

A few more you'll meet

  • PTR — reverse DNS, mapping an IP back to a name; important for mail server reputation.
  • SRV — locates services (used by VoIP, chat, some game protocols).
  • CAA — declares which certificate authorities may issue SSL certs for your domain.

How to inspect any domain's DNS

When something isn't resolving, look at the live records. Our free DNS lookup at /tools/dns-lookup queries A, AAAA, CNAME, MX, TXT and NS records for any domain and shows them in a clean table — no dig syntax to memorise. It's the fastest way to confirm a record actually took effect and to spot the typo behind a broken site or bouncing email.

Once your records point where they should, you need a solid server on the other end. Nxeon runs your site on a fast NVMe VPS with full root and a dedicated IP for that A record. See /vps.

#dns#records#domains#mx#cname#tools

Deploy your first server in under a minute

No credit card required to get started. Spin up a VPS, break things, and only pay for what you keep running.