CNAME vs A record
Both records point a name somewhere, but in different ways.
| A record | CNAME record | |
|---|---|---|
| Points to | An IP address, e.g. 192.0.2.10 |
Another name, e.g. example.com or shops.myshopify.com |
| Use it for | Your domain itself (@) and subdomains on your own server |
Subdomains such as www, shop or blog that should follow another name |
| If the target changes | You must update the IP yourself | It updates automatically, because it follows the other name |
| Can share its name with other records? | Yes | No. A CNAME must be the only record for that name |
When to use an A record
Section titled “When to use an A record”- Pointing
example.com(@) to your Ruachost hosting or another server - When a service gives you an IP address
When to use a CNAME
Section titled “When to use a CNAME”- Making
www.example.comfollowexample.com - When a service gives you a hostname, for example
shop→shops.myshopify.com
Why @ can’t be a CNAME
Section titled “Why @ can’t be a CNAME”Your root domain (example.com) must have other records, such as NS, SOA, MX for email and TXT for SPF. A CNAME can’t share its name with any other record, so the root domain can’t be a CNAME. Use an A record for @, and a CNAME for www.
Some DNS providers offer an ALIAS or ANAME record, which works like a CNAME at the root. Ruachost DNS doesn’t use these. If a platform asks for one, use the A record it also provides, or point www with a CNAME and redirect the root domain to www.