A
CNAME record is the correct choice when you need to point a domain name to another domain name, rather than directly to an IP address. An
A record points a hostname directly to a static IP address, while a CNAME record creates an alias, pointing one hostname to another hostname. This is ideal for your Netlify setup because it allows Netlify to manage the underlying IP addresses; if they change their infrastructure, your CNAME will automatically resolve to the new
IPs without requiring you to update your
DNS. In contrast, using an A record would require you to manually track and update IP addresses, risking downtime if they change. Crucially, a CNAME cannot be used on the root domain (like
mysite.com
) for most DNS providers due to conflicts with other essential records like MX for email; you must use it on a subdomain like
www.mysite.com
. For the root domain, you would typically use Netlify's provided A records or an ALIAS/ANAME record if your DNS provider supports it. For your subdomain, you would create a CNAME record like this in your DNS manager:
www.mysite.com. CNAME my-site-123.netlify.app.
The underlying concept is indirection and delegation, letting the target service control the final IP resolution.