When configuring DNS for your domain, you may encounter various record types, including CNAME and ALIAS records.
A CNAME (Canonical Name) record maps an alias domain to another domain name. This allows the alias domain to inherit all DNS records associated with the target domain.
Points a domain (e.g., alias.yourdomain.com
) to another domain (e.g., targetdomain.com
).
Used for subdomains (e.g., www.yourdomain.com
) that need to point to another domain.
Cannot coexist with other DNS records (e.g., A or TXT records) for the same domain.
www.yourdomain.com CNAME yourdomain.com
This configuration directs www.yourdomain.com
to resolve to the same IP address as yourdomain.com
.
An ALIAS record functions like a CNAME record but is designed to work at the root domain level (e.g., yourdomain.com
). Unlike CNAME records, ALIAS records are compatible with the root domain and coexist with other record types.
Allows the root domain to point to another domain.
DNS providers resolve ALIAS records to the target domain's IP address and serve it as an A record.
Works well with CDNs, load balancers, and other services requiring root domain redirection.
yourdomain.com ALIAS targetdomain.com
This configuration directs yourdomain.com
to resolve to the IP address of targetdomain.com
.
Feature | CNAME Record | ALIAS Record |
---|---|---|
Use Case | Subdomains | Root domains and subdomains |
Compatibility | Not allowed at the root domain | Allowed at the root domain |
Resolution | Points to another domain name | Resolves to an IP address |
Coexistence | Cannot coexist with other records | Can coexist with other records |
Use for subdomains, such as www.yourdomain.com
or blog.yourdomain.com
.
Best for simple redirection to another domain without the need for advanced configurations.
Use for root domains, such as yourdomain.com
, when pointing to services like CDNs or load balancers.
Ideal for scenarios where DNS resolution needs to return an IP address rather than another domain name.
CNAME Records:
Cannot be used at the root domain level.
May increase DNS query times since it requires an additional lookup.
ALIAS Records:
Not supported by all DNS providers.
Can introduce slight delays due to the resolution process at the DNS provider level.
Both CNAME and ALIAS records are essential tools in DNS configuration, but they serve distinct purposes. Choose CNAME records for subdomains and ALIAS records for root domains or more complex setups. If you’re unsure which record type to use, contact our Support Team for assistance.