You run the server
Use an A record (and AAAA) with your static IP. You control changes.
Monitor
Protect
Manage
By role
Security
Renewals
Monitoring
Use an A record when you know the server IP address, and a CNAME when a hostname owned by someone else should decide the address. An A record maps a name to an IPv4 address; a CNAME maps it to another name and cannot share that name with any other record.
| A record | CNAME record | |
|---|---|---|
| Points to | An IPv4 address | Another hostname |
| Allowed at the root domain | Yes | No (use ALIAS or flattening) |
| Can share a name with MX, TXT, other records | Yes | No |
| Follows target IP changes automatically | No, you edit the IP | Yes, the target owner changes it |
| Extra lookup for the resolver | No | Yes, one more step |
| Typical use | Own server, the apex | www, SaaS and CDN subdomains |
Constraints from RFC 1034, 3.6.2 and RFC 2181, 10.1.
Use an A record (and AAAA) with your static IP. You control changes.
Use a CNAME on a subdomain, so the platform can move servers without telling you.
Use A, or ALIAS/flattening if the platform only gives a hostname.
Use A/AAAA. A CNAME blocks MX and TXT on that name.
Follow the CDN docs. Most ask for a CNAME on www and an A or ALIAS at the apex.
Prefer A where you control the IP. Prefer CNAME where someone else does.
example.com. 3600 IN A 192.0.2.10
www.example.com. 3600 IN CNAME example.com.
shop.example.com. 3600 IN CNAME stores.example-shop.net.Set the record TTL to 300 seconds a day ahead so the change spreads quickly. See DNS TTL.
A name cannot have a CNAME and an A record at once; remove one before adding the other.
Create the A or CNAME with the new value in the same edit session to keep the gap short.
Query a public resolver and the authoritative nameserver with the DNS lookup.
Neither is better. A CNAME is easier to maintain when a third party manages the IP address, but it adds a lookup and has restrictions. An A record is direct and works anywhere, including the root domain.
A CNAME adds one extra DNS lookup the first time a resolver needs it. The result is cached for the TTL, so for most visitors the difference is a few milliseconds at most, and often none.
No. A CNAME excludes all other data on its name, so you cannot have a CNAME together with an A, MX or TXT record there. Remove one of them.
Either works. A CNAME to the root domain keeps the two names in sync with one IP address to maintain. An A record on www is equally valid and avoids the extra lookup.
Yes, and it is the most common layout. The root domain holds an A (and AAAA) record, and www is a CNAME to the root domain, so changing the IP in one place updates both names.
Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.