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
  1. CNAME vs A record at a glance
  2. What is an A record?
  3. What is a CNAME record?
  4. Why you can't use a CNAME on your root domain
  5. CNAME vs A record: which is better for speed and SEO?
  6. How to add an A record or CNAME
  7. Common A record and CNAME mistakes
  8. Other DNS records you'll meet
  9. Conclusion
  10. 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 recordCNAME record
Points toAn IPv4 address (e.g. 192.0.2.10)Another hostname (e.g. shops.example-host.com)
Used forYour own server, or a host that gives you an IPHosted platforms that give you a hostname
Root domain (yourname.com)YesNo, not in standard DNS
Subdomains (www, shop, blog)YesYes, the most common use
If the host changes its IPYou must update itUpdates automatically
Can share a name with other recordsYes (MX, TXT and so on)No, a CNAME must be alone at its name
Extra lookupNoYes, 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.

Example addresses from documentation ranges; use the values your host gives you.
HostTypeValueMeaning
@A192.0.2.10yourname.com goes to that server
@AAAA2001:db8::10The same, for IPv6
appA192.0.2.20app.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.
Example targets; your platform shows the exact value to copy.
HostTypeValueMeaning
wwwCNAMEyourname.sitebuilder-example.comwww follows your site builder's address
shopCNAMEshops.storeplatform-example.comThe shop subdomain follows the store platform
linksCNAMEcustom.linkpage-example.comYour 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

OptionHow it worksWhen to use it
A records from your hostPoint the root at the IPs your host publishesMost website builders and hosts support this
ALIAS / ANAME recordYour DNS provider looks up the target and returns its IPProviders that offer it (name varies)
CNAME flatteningYou enter a CNAME; the provider serves it as an A recordDNS providers that support flattening
Redirect root to wwwRoot forwards to www, which uses a CNAMEWhen 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

  1. 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.
  2. Open the DNS editor for your domain.
  3. 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.
  4. Leave TTL on automatic, or set 300 seconds if you expect to change it soon.
  5. Remove conflicting records for the same host, such as an old A record where you're adding a CNAME.
  6. 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

MistakeSymptomFix
CNAME and A record on the same nameRecord rejected, or unpredictable resultsKeep only one; a CNAME must be alone
CNAME at the rootEditor refuses it, or email breaksUse A records, ALIAS or flattening
CNAME on a name that also has MXEmail stops workingNever CNAME a name that receives email
Host entered as www.yourname.com in an editor that adds the domainCreates www.yourname.com.yourname.comEnter just www
Pointing a CNAME at an IPDoesn't resolveCNAMEs take hostnames; IPs go in A records
Old A records left behind after switching hostsSite sometimes shows the old versionDelete 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

RecordWhat it doesTypical use
MXSays which servers receive email for the domainSetting up email on your domain
TXTHolds text the outside world can readDomain verification, SPF, DMARC
NSSays which nameservers hold the domain's recordsChanging DNS provider
AAAAPoints a name to an IPv6 addressHosts with IPv6 support
CAALists which certificate authorities may issue SSL for youExtra security for HTTPS
SRVPoints a service to a host and portSome chat, calling and game services
Need a domain to point somewhere?Search 150+ extensions in one go, then use A records and CNAMEs to connect it to anything.Search domains

Current domain and hosting deals

Namecheap prices, first term only. Renewals cost more; ICANN fee may apply.

Hosting with simple DNS setupNamecheap hosting gives you the exact A records or nameservers to use, with a DNS editor that's easy to follow.See hosting

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.

Related posts