A record vs CNAME, what's the difference?
By Ash, Founder, HosteazePublished 2 min read
The short answer
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.

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 record | CNAME | |
|---|---|---|
| Points to | An IPv4 address, like 203.0.113.10 | Another hostname, like sites.example.net |
Works on the root domain (yourdomain.co.uk) | Yes | No |
Works on subdomains (www, shop) | Yes | Yes |
| Can sit alongside other records with the same name | Yes | No |
| If the host changes its IP address | You must update it | Updates 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:
- An A record on
@(the root domain) pointing to the IP address your host gives you. - A CNAME on
wwwpointing to your root domain, or to the hostname your host gives you.
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.




