Skip to main content
🌐
DNS & email

A and CNAME records

The two core DNS records: A points to a server's IP address, CNAME is an alias to another name

📖 Detailed description

The A record and the CNAME record are the two most commonly used DNS entries - and the two most commonly confused. Both answer the question "where can I find this domain?", but they do it differently. Understanding the difference between A and CNAME helps you avoid the classic configuration mistakes that stop a site from loading.

The A record (Address) is a direct translation of a name to an IP address, for example yourdomain.com → 192.0.2.10. It is the most fundamental entry - it tells the browser which server to connect to in order to fetch the site. Its IPv6 counterpart is the AAAA record.

The CNAME record (Canonical Name) is an alias - instead of pointing to an IP address, it points to another domain name. For example, www.yourdomain.com as a CNAME to yourdomain.com. The advantage is that when the target IP changes, you only update a single A record and every CNAME alias follows automatically. A key limitation: a CNAME cannot exist on the root domain, nor coexist with other records for the same name - which is why the root domain is almost always set with an A record.

So, A or CNAME record? In short: the root domain and the server use an A record; subdomains pointing to external services (a CDN, site hosting, a SaaS panel) are usually a CNAME. You can check which A and CNAME records your domain has with our free DNS Lookup tool at /dns.

Most common problems

A CNAME on the root domain

The standard forbids it - it breaks email (MX) and other records for that name

An A record with an old IP

After a server move the site still points to a stale address and does not open

A CNAME-to-CNAME chain

Each additional alias slows down name resolution and complicates debugging

Confusing A with CNAME

Setting an alias where an IP address is needed (or vice versa) breaks the service

How to fix it?

Point the root domain with an A record to the server's IP address

Set subdomains pointing to external services (CDN, SaaS) with a CNAME

Never put a CNAME on the domain root - use an A record or your provider's ALIAS/ANAME feature

After changing servers, update the A record and wait for propagation (mind the TTL)

Avoid long CNAME chains - each extra hop is another DNS query

Examples

Good example

yourdomain.com A 192.0.2.10 and www CNAME yourdomain.com

Bad example

yourdomain.com CNAME hosting.example.com (a CNAME on the root domain)

Check this indicator for your website

Get a detailed analysis and personalized tips on how to improve this element on your website.

Start free analysis