DomainsUpdated 8 min read
CNAME vs A Record: What's the Difference and Which Should You Use?
By the handle.tools team · Published

In this guide 10
- CNAME vs A record at a glance
- What is an A record?
- What is a CNAME record?
- Why you can't use a CNAME on your root domain
- CNAME vs A record: which is better for speed and SEO?
- How to add an A record or CNAME
- Common A record and CNAME mistakes
- Other DNS records you'll meet
- Conclusion
- Frequently asked questions
The CNAME vs A record question comes up the moment you connect a domain to anything: a website builder, an online shop, a link-in-bio page or an email service. Both records tell the internet where your domain should go. The difference is that an A record points to an IP address, while a CNAME points to another name and lets that name decide the address.
This guide explains both records in plain English, shows when to use each with real-world examples, covers the rule that trips most people up (you can't put a CNAME on your root domain), explains ALIAS and flattening, and lists the mistakes that cause broken sites.
CNAME vs A record at a glance
| A record | CNAME record | |
|---|---|---|
| Points to | An IPv4 address (e.g. 192.0.2.10) | Another hostname (e.g. shops.example-host.com) |
| Used for | Your own server, or a host that gives you an IP | Hosted platforms that give you a hostname |
| Root domain (yourname.com) | Yes | No, not in standard DNS |
| Subdomains (www, shop, blog) | Yes | Yes, the most common use |
| If the host changes its IP | You must update it | Updates automatically |
| Can share a name with other records | Yes (MX, TXT and so on) | No, a CNAME must be alone at its name |
| Extra lookup | No | Yes, one extra step to resolve the target |
What is an A record?
An A record (A for address) maps a name to an IPv4 address: the numeric address of a server. When someone visits yourname.com, the A record answers "go to 192.0.2.10".
When to use an A record
- Your root domain (yourname.com), which can't use a standard CNAME.
- Your own server or VPS with a fixed IP address.
- Hosts that tell you to add one or more A records with specific IPs.
- Load-balanced setups where you list several A records for the same name.
Multiple A records for one name
You can add several A records with the same host. Many website builders ask for two or more for your root domain, so visitors still reach the site if one server is down. Add every IP they list, exactly as given, and don't mix them with A records left over from an old host: resolvers pick from all of them, so a stale IP sends some visitors to a dead or wrong site.
When a host changes its IP
If you use A records and your host moves to new servers, they'll email you new IP addresses to enter. Until you update them, your site may be unreachable. That's the main practical advantage of a CNAME: the platform changes its own records and you don't have to do anything.
A vs AAAA
An AAAA record does the same job for IPv6 addresses (the longer, newer format). If your host gives you both, add both. Visitors on IPv6 networks will use the AAAA record.
| Host | Type | Value | Meaning |
|---|---|---|---|
| @ | A | 192.0.2.10 | yourname.com goes to that server |
| @ | AAAA | 2001:db8::10 | The same, for IPv6 |
| app | A | 192.0.2.20 | app.yourname.com goes to a different server |
What is a CNAME record?
A CNAME (canonical name) record makes one name an alias of another. Instead of an address, it says "look up that other name instead". The other name then supplies the actual address.
Why platforms prefer CNAMEs
Hosted services move servers and change IPs all the time. If you point www.yourname.com at their hostname with a CNAME, they can change their infrastructure without you touching your DNS. That's why shop builders, help desks, link-in-bio tools and email services almost always ask for a CNAME.
When to use a CNAME
- www.yourname.com pointing at your website builder's hostname.
- shop.yourname.com pointing at your store platform.
- links.yourname.com for a link-in-bio page. The link in bio custom domain guide walks through it.
- help, docs or status subdomains pointing at hosted tools.
- Email and verification records some providers ask for, such as DKIM keys published as CNAMEs.
| Host | Type | Value | Meaning |
|---|---|---|---|
| www | CNAME | yourname.sitebuilder-example.com | www follows your site builder's address |
| shop | CNAME | shops.storeplatform-example.com | The shop subdomain follows the store platform |
| links | CNAME | custom.linkpage-example.com | Your link-in-bio page on your own domain |
Why you can't use a CNAME on your root domain
This is the most common DNS question of all. The root of your domain (yourname.com with nothing in front, shown as @ in most editors) must hold records that define the domain itself, including SOA and NS records. A CNAME isn't allowed to share its name with any other record, so standard DNS doesn't permit a CNAME at the root.
Your options for the root domain
| Option | How it works | When to use it |
|---|---|---|
| A records from your host | Point the root at the IPs your host publishes | Most website builders and hosts support this |
| ALIAS / ANAME record | Your DNS provider looks up the target and returns its IP | Providers that offer it (name varies) |
| CNAME flattening | You enter a CNAME; the provider serves it as an A record | DNS providers that support flattening |
| Redirect root to www | Root forwards to www, which uses a CNAME | When the host only gives you a hostname |
CNAME vs A record: which is better for speed and SEO?
Neither record type affects SEO. Search engines see the website, not the DNS record that pointed to it.
- Speed: a CNAME adds one extra lookup step. In practice it's usually a few milliseconds and resolvers cache it, so visitors won't notice.
- Reliability: a CNAME is often more reliable for hosted platforms, because it follows their infrastructure changes automatically.
- Maintenance: A records need updating if your host's IP changes; CNAMEs don't.
- What matters for SEO: one canonical version of your site (root or www, not both) with the other redirecting to it, and HTTPS working on both.
Choose whichever your host recommends. The worst choice is the one that doesn't match their instructions.
How to add an A record or CNAME
- Find where your DNS is managed: your registrar, your host or a DNS provider such as Cloudflare. It's wherever your nameservers point. Our guide to domain vs hosting explains how to tell.
- Open the DNS editor for your domain.
- Add a record: choose the type (A or CNAME), enter the host (@ for root, or a prefix like www or shop) and paste the value from your provider.
- Leave TTL on automatic, or set 300 seconds if you expect to change it soon.
- Remove conflicting records for the same host, such as an old A record where you're adding a CNAME.
- Save and verify in your platform's dashboard. Most platforms check the record and then issue an SSL certificate.
Changes usually work within minutes but can take longer to reach everyone. If something seems slow, read DNS propagation explained before changing anything else.
Common A record and CNAME mistakes
| Mistake | Symptom | Fix |
|---|---|---|
| CNAME and A record on the same name | Record rejected, or unpredictable results | Keep only one; a CNAME must be alone |
| CNAME at the root | Editor refuses it, or email breaks | Use A records, ALIAS or flattening |
| CNAME on a name that also has MX | Email stops working | Never CNAME a name that receives email |
| Host entered as www.yourname.com in an editor that adds the domain | Creates www.yourname.com.yourname.com | Enter just www |
| Pointing a CNAME at an IP | Doesn't resolve | CNAMEs take hostnames; IPs go in A records |
| Old A records left behind after switching hosts | Site sometimes shows the old version | Delete records you no longer use |
Delete what you don't use
A CNAME pointing at a service you've cancelled can be claimed by someone else on that service, letting them show content on your subdomain. Review your records whenever you stop using a platform.
Other DNS records you'll meet
| Record | What it does | Typical use |
|---|---|---|
| MX | Says which servers receive email for the domain | Setting up email on your domain |
| TXT | Holds text the outside world can read | Domain verification, SPF, DMARC |
| NS | Says which nameservers hold the domain's records | Changing DNS provider |
| AAAA | Points a name to an IPv6 address | Hosts with IPv6 support |
| CAA | Lists which certificate authorities may issue SSL for you | Extra security for HTTPS |
| SRV | Points a service to a host and port | Some chat, calling and game services |
Current domain and hosting deals
Namecheap prices, first term only. Renewals cost more; ICANN fee may apply.
Conclusion
Recap
In the CNAME vs A record choice, an A record points a name to an IP address and works anywhere, including your root domain, while a CNAME points a name to another hostname and is ideal for subdomains on hosted platforms. A CNAME can't sit at the root or share a name with other records.
Follow your provider's instructions, use A records, ALIAS or flattening for the root, CNAMEs for subdomains, and delete records you no longer use.
Final thoughts
If you're still choosing the domain itself, search 150+ extensions with domain search, and check any domain's status with the domain expiration checker before you connect it.
Frequently asked questions
What is the difference between a CNAME and an A record?
An A record points a domain or subdomain to an IP address. A CNAME points it to another hostname, which then provides the address.
Can I use a CNAME for my root domain?
Not in standard DNS. Use A records for the root, or an ALIAS, ANAME or flattened CNAME if your DNS provider supports it.
Is a CNAME or A record better?
Neither is better overall. Use an A record when you have an IP address and a CNAME when a platform gives you a hostname, especially for subdomains.
Does a CNAME slow down my website?
It adds one extra DNS lookup, usually a few milliseconds and cached by resolvers, so visitors won't notice.
Do A records or CNAMEs affect SEO?
No. Search engines don't rank sites by DNS record type. Having one canonical version of your site and working HTTPS matters far more.
Can I have a CNAME and an MX record on the same name?
No. A CNAME must be the only record at its name, so never put a CNAME on a name that needs to receive email.
What is an ALIAS record?
A provider feature that lets you point your root domain at a hostname. The provider looks up the hostname's IP and serves it as if it were an A record.
Should www use a CNAME or an A record?
Usually a CNAME, pointing at the hostname your website builder gives you. If your host only provides IP addresses, use A records for www as well as the root.
How long does it take for a new A record or CNAME to work?
Usually minutes for a new record. Changes to existing records can take up to the old record's TTL to reach everyone.