DNS Records Explained: A, AAAA, CNAME, MX, TXT — Domains & Email Domains & Email

DNS Records Explained: A, AAAA, CNAME, MX, TXT

By Genhost Team 3 min read

Every time someone visits your site or emails your domain, DNS records tell the internet where to go. They look cryptic at first, but each type has one simple job. Here’s what the common records do and when you’d use them.

Where DNS records live

Your records live wherever your domain’s nameservers point — usually your hosting control panel (cPanel’s Zone Editor), your registrar, or a DNS provider like Cloudflare. Edit them in the one place that controls your domain, or your changes won’t take effect.

The A record — name to IPv4 address

The A record points a domain or subdomain to an IPv4 address (like 203.0.113.10). This is what connects your domain to your hosting server.

  • @ (root domain) → your server’s IP
  • www → your server’s IP (or a CNAME, below)

The AAAA record — name to IPv6 address

Same idea as an A record, but for a newer IPv6 address (like 2001:db8::1). Add it only if your server has an IPv6 address.

The CNAME record — name to another name

A CNAME makes one name an alias of another. Instead of an IP, it points to a hostname, which then resolves to an IP.

  • www → yourdomain.com
  • shop → mystore.someplatform.com

Use a CNAME when a service asks you to point a subdomain at their hostname. You can’t use a CNAME on the root domain itself — use an A record there.

The MX record — where email goes

MX (Mail Exchange) records tell other mail servers which server handles email for your domain. If your email is on your hosting, your MX record points to your mail server (e.g. mail.yourdomain.com). Get this wrong and email stops arriving.

Each MX record has a priority number — lower numbers are tried first.

The TXT record — text for verification and email security

TXT records hold free-form text, used mainly for:

  • SPF — which servers may send email as your domain.
  • DKIM — the public key that verifies your email’s signature.
  • DMARC — your policy for mail that fails those checks.
  • Domain verification — proving ownership to Google, Microsoft and others.

See our guide to SPF, DKIM and DMARC for the email ones.

The NS record — which nameservers are in charge

NS (Name Server) records list the authoritative nameservers for your domain. You usually set these at your registrar, not in the zone file.

Editing records safely

  • Change one thing at a time and note what it was before.
  • Lower the TTL a day ahead of a planned change so it takes effect quickly, then raise it back.
  • Give it time. Changes propagate over minutes to hours; use an online DNS checker to watch them update.

Manage DNS the easy way

On our Web Hosting and Reseller Hosting, cPanel’s Zone Editor lets you add and edit every record type from one screen, and our support team can check a record if email or a subdomain isn’t resolving. If you’re still unsure which records to set, our what are nameservers guide explains the bigger picture.

Frequently asked questions

What is the difference between an A record and a CNAME?

An A record points a name directly to an IP address. A CNAME points one name to another name (an alias), which then resolves to an IP. Use an A record for your root domain and a CNAME when you want a subdomain to follow another hostname.

What is a TTL on a DNS record?

TTL (time to live) is how long, in seconds, other servers cache the record before checking again. A lower TTL makes changes take effect faster but means more lookups. Lower it before a planned change, then raise it again afterwards.

Why are my DNS changes not working yet?

DNS changes take time to propagate as caches around the world expire, usually a few minutes to a few hours and up to 24-48 hours. Double-check you edited the record at the provider that actually controls your domain's DNS (where your nameservers point).