Skip to content

Website guide

CNAME vs A Record:
Which Do You Need to Connect a Domain?

Use whichever your builder tells you to. In practice that is an A record on the root domain (example.com) and a CNAME on www, because DNS does not allow a CNAME beside the records a root domain must have.

Figment editorial teamPublished Updated

An A record points your domain directly at a server's numeric IP address. A CNAME record points it at another domain name, which is then looked up itself. Both get a visitor to the same website. Most website builders ask you to add an A record for your root domain (example.com) and a CNAME for www, because the DNS standard does not allow a CNAME at the root. Below are what each record does, why builders split them that way, and real DNS values from one builder's setup guide.

What does an A record do?

An A record maps a name straight to an IP address. Cloudflare's DNS documentation defines the pair plainly: "A and AAAA records map a domain name to one or multiple IPv4 or IPv6 address(es)" (Cloudflare, "DNS record types"). An A record holds an IPv4 address (the AAAA variant holds IPv6). When a visitor's browser looks up your domain, it asks a DNS server for the A record, gets back an IP address like 198.51.100.10, and connects to that server directly. There is no second lookup.

How do an A record and a CNAME record compare?

A recordCNAME record
Points toAn IPv4 address (AAAA holds IPv6)Another domain name
LookupsOneOne extra, to resolve the target name
If the host changes its IP addressesYou update the recordNothing to change on your side
Allowed at the root domainYesNo, unless your DNS host offers CNAME flattening or an ALIAS record
Typical builder useRoot domain (example.com)www

What does a CNAME record do?

A CNAME record holds a name instead of an address. Cloudflare's documentation says "CNAME records map a domain name to another (canonical) domain name" (same source). A CNAME at www.example.com might point to sites.hostingprovider.example, and the resolver then looks up that name's own A record to find an IP address. This costs one extra step, but your website host can change its servers' IP addresses without you touching your own DNS again. You point at a name they control, not a number that can go stale.

Why do builders ask for an A record on the root and a CNAME on www?

The split comes from a rule in the DNS specification, not from builder preference. RFC 1034, one of the foundational DNS standards, states: "If a CNAME RR is present at a node, no other data should be present; this ensures that the data for a canonical name and its aliases cannot be different" (IETF, RFC 1034, section 3.6.2). Your root domain already has other required records at that name: at minimum an SOA (start of authority) record and NS (nameserver) records, which is how the domain has a DNS zone at all. A CNAME cannot share a name with those, so the root domain (also called the apex or the bare domain) generally cannot hold a CNAME. www.example.com is a separate name with no competing records, so it is free to be a CNAME.

That is why a builder's setup guide gives two instructions: an A record (or several) for example.com, and a CNAME for www.example.com pointed at the builder's own hosting name.

Which should I use, an A record or a CNAME?

Use whichever your builder's setup guide gives you for each name: an A record on the root domain and a CNAME on www. Use a CNAME on the root only if your DNS host documents CNAME flattening or an ALIAS record.

Can I put a CNAME on my root domain anyway?

Not a plain CNAME, because of the RFC restriction above. Several DNS providers offer a workaround under another name: CNAME flattening or an ALIAS record, depending on the vendor. Cloudflare describes its version this way: "CNAME flattening speeds up CNAME resolution and allows you to use a CNAME record at your zone apex." In practice, "Cloudflare finds the IP address that a CNAME points to" and then "returns the final IP address instead of a CNAME record" (Cloudflare, "CNAME flattening"). The DNS host does the lookup on its own servers and hands your visitors a plain A-record-style answer, so the RFC rule is never broken.

Not every DNS host offers this. If yours does not document CNAME flattening or an ALIAS record type, use the A record your builder gives you for the root domain.

What is TTL, and how long does a DNS change take to work?

TTL (time to live) is how long a record may be cached, usually in seconds, so it sets how long a change takes to reach everyone. Cloudflare's documentation defines it: "Time to Live (TTL) is a field on DNS records that controls how long each record is cached and — as a result — how long it takes for record updates to reach your end users" (Cloudflare, "TTL"). The trade-off is in the same source: "Longer TTLs speed up DNS lookups by increasing the chance of cached results, but a longer TTL also means that updates to your records take longer to go into effect" (same source). A short TTL (a few minutes) makes future changes propagate faster at a small cost in lookup performance. A long TTL (hours or a day) is more efficient day to day, but a mistake takes longer to fix.

Propagation is not instant for the same reason. Old answers can stay cached at your ISP or in your own browser until their TTL expires, so a DNS change that looks correct in a lookup tool can still take time to reach every visitor.

What do real DNS values for a builder look like?

Squarespace's DNS Connect setup shows the pattern with real values. To point an outside domain at a Squarespace site, it documents a CNAME for www pointed at ext-cust.squarespace.com, and four A records, all with @ (meaning the root) as the host, pointed at 198.185.159.144, 198.185.159.145, 198.49.23.144, and 198.49.23.145 (Squarespace, "Connect a third-party domain to your Squarespace site"). Squarespace also documents a separate CNAME, with a unique verification code, pointed at verify.squarespace.com. That one confirms you control the domain before the connection goes live. Our full guide to Squarespace domains covers the rest of that setup, including nameserver-based connection as an alternative to record-by-record DNS.

The shape is the same everywhere, though IPs and CNAME targets differ by host: multiple A records at the root for redundancy, one CNAME at www pointed at the host's own domain name, and sometimes a verification record.

What if my DNS change doesn't work?

First check that you entered the record at @ (root) or www as intended, and whether your DNS provider requires a trailing dot on the CNAME target (some do). A public DNS lookup tool, used from a browser or terminal, shows what is being returned right now. Compare that against the values your builder's guide gave you.

If the values are right and the name is not resolving yet, the TTL of the old record is most likely still cached somewhere between you and the visitor. Wait out the old TTL before changing anything else. If you edited the wrong record, put the old A or CNAME record back exactly as it was. That is why you should write down your full existing DNS zone before making any change, not just the records you think you are touching.

MX records, which route your email, live at the same root name as your A records but are a separate record type. Changing A records for a website move does not touch MX records unless you edit them directly, so leave them alone. Our guide to switching builders without breaking email covers which records are safe to touch.

Where does this fit if I'm moving my whole site?

Connecting a domain is one piece of a larger move. If you are taking the domain's registration itself somewhere else, rather than just repointing DNS, that is a different process with its own lock periods and authorization codes. See our guide to transferring a domain away from a website builder. If a builder switch is the reason you are touching DNS, our website migration checklist covers the domain step in the order that keeps the rest of the site working. If you design in Figma and publish with the Figment Figma plugin, its Pro and Studio plans support custom domains (up to 10 and up to 50), and you add records at your registrar as described above.