Skip to content

A record vs CNAME, what's the difference?

By Ash, Founder, HosteazePublished 2 min read

An A record points a domain name straight at an IP address, such as 203.0.113.10. A CNAME points a name at another name, which then supplies the address. Use an A record for your root domain and a CNAME for subdomains like www when your host gives you a hostname. A CNAME can't sit on the root domain.

Yellow wooden signposts pointing in different directions on a mountain path
Credit: GregMontani via Pixabay

Both records do the same basic job: they tell browsers where your website lives. The difference is whether they give the address directly or send the browser to ask somewhere else. Pick the wrong one and you get an error message in your DNS panel, or a site that quietly breaks when your host changes servers.

What's the difference between an A record and a CNAME?

A recordCNAME
Points toAn IPv4 address, like 203.0.113.10Another hostname, like sites.example.net
Works on the root domain (yourdomain.co.uk)YesNo
Works on subdomains (www, shop)YesYes
Can sit alongside other records with the same nameYesNo
If the host changes its IP addressYou must update itUpdates automatically

An A record is a street address. A CNAME is "same address as that place over there". If that place moves, everyone following the CNAME moves with it.

Why can't I use a CNAME on my root domain?

The DNS rules say a name with a CNAME can't have any other records. Your root domain always needs other records: the SOA and NS records that make DNS work at all, plus usually MX and TXT records for email. Put a CNAME there and those would be ignored, which is why most DNS panels refuse to save it.

Some DNS providers get round this with "CNAME flattening" or an ALIAS record, which looks up the address for you and answers as if it were an A record. If your provider offers it and your host recommends it, it's fine to use.

Which should I use for my website?

Follow what your host tells you. The most common setup is:

That way, if the IP address ever changes, you only update one record. Website builders and hosted shops often give you a hostname instead of an IP; that goes in a CNAME for www, and the root domain then usually redirects to it.

For the full walk-through, see how to point a domain to a website. After saving either record, allow time for DNS propagation before panicking.

Frequently asked questions

Is an A record or CNAME faster?

An A record saves one lookup, but the difference is a few milliseconds at most and usually cached. Choose based on what's easier to maintain, not speed.

What is an AAAA record?

The same as an A record but for an IPv6 address, which looks like 2001:db8::1. If your host gives you one, add it alongside the A record.

What is CNAME flattening or an ALIAS record?

A feature some DNS providers offer that lets you point the root domain at a hostname. The provider looks up the address behind the scenes and answers with it, so it behaves like an A record.

Sources

  1. RFC 1034, Domain Names, Concepts and Facilities (section 3.6.2, aliases)
  2. Cloudflare, DNS record types
  3. Cloudflare, CNAME flattening
The Earth from space covered in a web of glowing network connections, showing how DNS answers spread worldwideQuestionHow long does DNS propagation take?Most DNS changes are visible within a few minutes to an hour, but some take up to 48 hours. The wait depends on the record's TTL, which tells servers how long to keep the old answer, and on whether you changed a record or your nameservers. Nameserver changes are usually the slowest.Email and domains · 13 October 2026Tangled mess of electrical cables on a telegraph pole against a blue skyQuestionHow do I fix "SPF record too many DNS lookups"?SPF allows a maximum of 10 DNS lookups. Every include, a, mx, ptr, exists and redirect term counts, including the ones hidden inside each include. Go over and SPF returns a permanent error, so it fails for all your email. Fix it by removing services you no longer use and dropping unnecessary a and mx terms.Email and domains · 13 October 2026Traffic light showing a red stop signal under a blue bicycle signalQuestionDMARC p=none vs quarantine vs reject, which should I use?p=none tells receivers to deliver failing email as normal and just send you reports. p=quarantine sends failing email to spam. p=reject blocks it completely. Start at none, read the reports until every service you use passes, then move to quarantine and finally reject. Skipping straight to reject can block your own invoices.Email and domains · 12 October 2026Magnifying glass and pen resting on printed spreadsheets, ready to check the detailsQuestionHow do I check if my domain has DMARC?Look up the TXT record at _dmarc.yourdomain.com. The quickest way is the free Google Admin Toolbox Dig tool. Enter _dmarc followed by your domain, choose TXT, and look for a value starting v=DMARC1. If nothing comes back, your domain has no DMARC record and you should add one.Email and domains · 12 October 2026Open red mailbox with a stream of envelopes flying away from it, like email going astrayQuestionWhy are my emails going to spam?The most common reason is missing or broken email authentication. If your domain has no SPF, DKIM or DMARC records, Gmail and Outlook can't prove the email is really from you. After that come a poor sender reputation, a shared server with a bad history, and messages that look like marketing. Check authentication first.Email and domains · 12 October 2026

Want email on your own domain?

Hosteaze hosting plans let you set up mailboxes on your own domain. See what each plan includes.

See hosting plans