DNS Record Types for Beginners: A/AAAA/CNAME/MX/NS/TXT/SPF and When to Use Each

The first time you open a DNS management panel, a wall of "A records," "CNAME," and "MX" can be overwhelming. This guide explains the 7 most common record types, with a comparison table and typical combinations, so you know which one to configure when. For more domain knowledge, follow the domain industry category.

1. What a DNS Record Is

A DNS record is one rule in the domain resolution table — it tells DNS what a domain or subdomain maps to. Each record has a type, a host (like @ for the bare domain and www for a subdomain), a value, and a TTL (cache time). TTL is how long other servers cache the record, in seconds: shorter TTL means changes propagate faster but slightly more query load; common values are 300, 600, and 3600. Misconfigured records can break your site or, worse, stop your email. For troubleshooting, see domain resolution troubleshooting.

2. Common Record Types, One by One

  • A record: points a domain to an IPv4 address — the most common. @ A 203.0.113.10 means the bare domain resolves to that IP.
  • AAAA record: like A, but points to an IPv6 address (e.g., 2001:db8::10). Needed to support IPv6 users.
  • CNAME record: aliases a domain to another domain, e.g., www.example.com CNAME example.com. A common use is pointing a subdomain at a CDN hostname. See the CDN beginner's guide. Note that a CNAME usually cannot coexist with records like MX on the bare domain (some providers offer CNAME flattening).
  • MX record: specifies the domain's mail server with a priority number (lower = more preferred). If you cannot receive email, the MX is often the culprit. Pair with SPF via SPF/DKIM/DMARC setup.
  • NS record: specifies which DNS servers are authoritative for the domain. Switching DNS providers means changing NS.
  • TXT record: arbitrary text, commonly used for domain ownership verification (e.g., Google verification) and email security policies (SPF value).
  • SPF record: a TXT record listing which servers are allowed to send mail for your domain, preventing others from spoofing it.

Extra: some providers support wildcard records (*) that point any subdomain at one target — handy for bulk subdomains, but they can conflict with specific records and are scanned more easily, so keep them off unless needed. For finer-grained service discovery (e.g., specific ports), SRV records exist, but beginners rarely need them.

3. Record Type Comparison Table

Type Purpose Example value Typical use
A Domain → IPv4 203.0.113.10 Main site resolution
AAAA Domain → IPv6 2001:db8::10 IPv6 websites
CNAME Domain → another domain cdn.example.net Subdomain to CDN
MX Mail server + priority mail.example.com (10) Send/receive email
NS Authoritative DNS servers ns1.example.com Choose DNS provider
TXT Arbitrary text "google-site-verification=..." Ownership checks, SPF
SPF Allowed senders "v=spf1 include:_spf.example.com ~all" Anti-spam

Multiple record types can coexist on the same host (e.g., A, MX, and TXT together), but generally only one record per type per host — check with your provider for exceptions.

4. Typical Combinations

  1. Website only: one A record (or a CNAME to a CDN) is enough; for CDN onboarding see CDN setup.
  2. Website + email: A + MX + SPF and other TXT records — do not forget SPF/DKIM/DMARC.
  3. Multilingual / multi-site: separate subdomains (blog., m.), each with its own A/CNAME. See subdomain vs. custom domain.
  4. Acceleration / smart routing: some providers return different IPs by region; see DNS smart routing;
  5. Email hardening: add DKIM and DMARC TXT records alongside SPF to improve inbox delivery — see email authentication setup.

6. Three Things to Remember Before Editing Records

  1. Back up first: before changing high-risk records like MX or NS, take a screenshot or export the current config so you can restore quickly;
  2. Lower the TTL before switching: to speed up propagation, lower TTL in advance (e.g., 300s), then restore the normal value after it settles;
  3. Do not delete system records blindly: records auto-created by the registrar (e.g., verification TXT) should be confirmed before removal — deleting them can break verification or resolution.

After editing, verify with an online tool or dig example.com A instead of waiting blindly. Verification tip: use dig or an online lookup tool to inspect the returned value and confirm the record matches expectations.

7. FAQ

Q: How long after editing a record does it take effect?
It depends on the TTL. Usually minutes to tens of minutes locally, and full global sync can take hours.

Q: Can an A record and a CNAME share the same subdomain?
Both occupy the hostname, so they generally cannot coexist. For the bare domain with a CDN, use the provider's A record values or CNAME flattening.

Q: What happens if my SPF is wrong?
At best email lands in spam; at worst it is rejected. See the SPF configuration tutorial. For further hardening, see domain and hosting security tips.

Q: Can a CNAME point to an IP?
No. The value of a CNAME must be a domain. Use an A or AAAA record when you need a subdomain to resolve to an IP.

Q: Are domain resolution and DNS records the same thing?
Basically yes. Resolution is the process, records are the rules; "configuring resolution" usually means adding or editing DNS records.