dns
A record vs CNAME: what's the difference?
An A record points a name to a numeric internet address. A CNAME points a name to another name. When to use which, and why the bare domain can't have a CNAME.
Contents
An A record points a name, such as www.yourname.nl, to a numeric internet address like 192.0.2.10. A CNAME points a name to another name, such as host.example.com, and says "look that one up instead". Hosts usually give you a CNAME for www. The name without www cannot have a CNAME, so it gets an A record or a forward.
Both are lines in your DNS settings. If DNS itself is new to you, start with what DNS is, in plain words. If you are here because an AI built you a website and you want it on your own domain, our guide to getting it online walks through the whole route.
What is an A record?
An A record says: this name lives at this numeric internet address (an IPv4 address, four numbers with dots). Picture the contact card for your domain. The A record is the home address field, written in numbers: "www.yourname.nl lives at 192.0.2.10."
A browser that reads an A record has everything it needs. It goes straight to that address.
What is a CNAME?
A CNAME (canonical name) says: this name is just another name for that name; look that one up instead. On the contact card, it is the field "same as this other contact". "www.yourname.nl: see host.example.com."
A browser that reads a CNAME does one more lookup, for the other name, and uses whatever address it finds there. If the host moves its computers to a new address, it only updates its own card. Your CNAME keeps working without you doing anything. That is why hosts prefer it.
How do they compare?
| A record | CNAME | |
|---|---|---|
| Points to | A numeric address (IPv4), such as 192.0.2.10 | Another name, such as host.example.com |
| Contact card picture | Home address in numbers | "Same as this other contact" |
| If the host changes address | You must update the line | Nothing to do; the host updates its own name |
| Can share its name with other lines | Yes (for example with MX and TXT) | No, it must be the only line for that name |
| Allowed on the name without www | Yes | Usually not |
| Typical use for a website | The name without www, or www at some hosts | www |
There is also the AAAA record: the same idea as an A record, for the newer and longer IPv6 addresses. Add one only if your host gives you one.
Which one do you use for www, and which for the name without www?
Follow your host's instructions; they know their own setup. The common pattern is:
www.yourname.nlgets a CNAME that points to a name at your host.yourname.nl(no www) gets either an A record with your host's address, or a forward tohttps://www.yourname.nlthat you set at your domain provider.
The forward is handy because it keeps your visitors on one address. Our help page on forwarding the name without www to www shows how. UpSheGoes, for example, gives you a CNAME for www and asks you to forward the name without www; see how it works.
Why can't the name without www have a CNAME?
Because of one strict rule. RFC 1034, the standard that defines DNS, says in section 3.6.2: "If a CNAME RR is present at a node, no other data should be present." RFC 1912 repeats it: "A CNAME record is not allowed to coexist with any other data."
The name without www always has other data. It holds the NS lines that name your nameservers, and usually your email lines: the MX lines and the SPF line. A CNAME there would have to push all of those out. Your email would break, and so might the whole domain. RFC 1912 even gives this exact mistake as an example.
Domain providers follow the rule in their own words. Strato's help page says a CNAME is only available on subdomains, because the main domain has NS records that cannot be removed (checked on 12 November 2026).
The exception: CNAME flattening. Some DNS services let you type a CNAME on the name without www anyway, and quietly turn it into an address. Cloudflare calls this CNAME flattening: it looks up the address behind the other name and answers with that address, so the outside world sees an ordinary A record. It only works where your DNS service offers it. The help pages of TransIP, Strato, Hostnet, Antagonist and mijndomein do not mention it, so unless your provider says otherwise, assume you cannot.
What do the lines look like in practice?
Here is a typical set for yourname.nl, with a website at a host and email at Microsoft 365. Panels differ: some show the name without www as @, some leave the name blank, some show the full name.
| Type | Name | Value | Job |
|---|---|---|---|
| A | @ | 192.0.2.10 | Website without www (or use a forward instead) |
| CNAME | www | host.example.com | Website on www |
| MX | @ | the value Microsoft gives you | Email delivery |
| TXT | @ | v=spf1 include:spf.protection.outlook.com -all | Who may send email |
| CNAME | autodiscover | the value Microsoft gives you | Outlook setup |
Notice that @ has an A record, an MX line and a TXT line together. That is allowed. www has only its CNAME. That is the rule in action.
What are the most common mistakes?
- A CNAME next to another www line. Remove the old www line (A or CNAME) first, then add the new one.
- https:// in the value. A CNAME value is a name only. mijndomein's help page says it plainly: no URL and no IP address.
- A missing or extra full stop. In DNS, a full name ends with a dot. TransIP and Antagonist (in its hosting panel, DirectAdmin) ask you to type that dot at the end of a CNAME value that points to another domain; without it, some panels glue your own domain to the end. Other panels add it for you. Check your provider's page.
- Changing the email lines too. The website never needs your MX, SPF or DKIM lines. See connecting a domain without breaking your email.
- Expecting it to work at once. Copies of the old line stay around for a while, from minutes up to a day depending on the provider.
My website host gave me these DNS instructions: [paste them]. My domain is at [provider]. Tell me, line by line, whether each one is an A record, a CNAME or a TXT record, what Name and Value I fill in at my provider, and which existing line (if any) it replaces. Remind me not to touch my email lines.
How do you check which one you have?
Use the free Google Admin Toolbox Dig. Type www.yourname.nl and choose CNAME, then type yourname.nl and choose A. You see exactly what the world sees right now (checked on 12 November 2026).
Sources and further reading
Checked on 12 November 2026.
- RFC 1034, section 3.6.2: Domain names, concepts and facilities
- RFC 1912, section 2.4: Common DNS operational and configuration errors
- Cloudflare Docs: CNAME flattening
- Cloudflare Learning Center: What is a DNS CNAME record? and What is a DNS A record?
- Strato: How to configure a CNAME record (in Dutch)
- mijndomein: DNS records (in Dutch)
- Antagonist: Managing DNS records in DirectAdmin (in Dutch; the full stop rule and "no CNAME next to an A record for www")
- TransIP: DNS and nameservers in the control panel (in Dutch)
Questions
Fair questions, straight answers
What is the difference between an A record and a CNAME, in one line?
An A record says 'this name lives at this numeric address'. A CNAME says 'this name is another name for that name, look that one up instead'.
Which one should I use for www?
Whatever your website host tells you. Most hosts give a CNAME for www, because then they can change their own addresses without asking you to update anything.
Can I put a CNAME on my domain without www?
Usually not. DNS rules say a CNAME cannot share a name with any other line, and the name without www always has other lines (nameservers, and often your email lines). Use an A record or your provider's forwarding setting instead. Some DNS services, such as Cloudflare, offer CNAME flattening as a workaround.
Can a name have both an A record and a CNAME?
No. If www has a CNAME, it cannot also have an A record. Remove the old www line first, then add the new one. Many panels refuse to save the second line anyway.
Does a CNAME slow down my website?
Barely. It adds one extra lookup the first time, and the answer is then kept for a while. A visitor will not notice.
Do I put https:// in the value of a CNAME?
No. The value of a CNAME is a name only, such as customers.example.com. No https://, no slash, no page. Some panels want a full stop at the end of the name; check your provider's help page.
What is an AAAA record?
The same as an A record, but for the newer, longer IPv6 addresses. If your host gives you only an A record, you do not need to add an AAAA record.
Ready to see your site go up?
Your AI does the work. You pay €8.47 a month incl. VAT and cancel any time.
€8.47 a month incl. VAT (€7.00 excl. VAT). Cancel any time.