Knowing the difference between a CNAME and an ALIAS record will save you time during the configuration phase of your DNS records. It helps you avoid potential problems with domain resolution and downtime. Even though there is a high resemblance between these records, they differ greatly in their use cases and behavior.
In this article, we will cover strategies that will help you differentiate between CNAME and ALIAS records, where and how to use them correctly, and what mistakes to be on the lookout for.
What is a CNAME Record?
A CNAME (Canonical Name) record points one domain or subdomain to another. Instead of directing to an IP, a CNAME record directs to a hostname.
Best For:
- Used for Subdomains such as www or blog.
- Used for redirecting multiple domains to a single destination.
- Used for dynamic services such as CDNs.
Instance:
- www.example.com → example.net
- This means that for anyone accessing www.example.com, their DNS queries will be resolved via example.net.
Key Limitations:
- You cannot use CNAMEs on root domains (like example.com).
- You can have only one CNAME per subdomain.
- CNAMEs must not coexist with other types of records, like MX or A for the same hostname.
Related Read: ❯ How to Add and Delete CNAME Records in cPanel and WHM?
What is an ALIAS Record?
Root domain pointing is what ALIAS records are designed to enable. Like CNAMEs, they also point domains to other domains. However, ALIAS records only work at the root domain level.
Best For:
- Pointing the apex/root domain (e.g., example.com) to another domain
- Compatibility with providers requiring IP-based responses
- DNS providers that support “flattening” techniques
Instance:
- “example.com” points to “example.net.”
- With ALIAS, IP resolution is possible for users; however, a different hostname can be behind the scenes.
Key Advantage:
- More than one DNS record can be created with ALIAS records, and that enhances their flexibility greatly. For example, MX records can still be included, which is an advantage over CNAMEs.
Adding an ALIAS Record in MilesWeb’s mPanel
In MilesWeb’s mPanel, adding what functions as an ALIAS record is done using the CNAME format—but with behavior adapted for apex/root domains.
How to Set It Up:
When adding the ALIAS-like record for your root domain:
- DNS Record Type: CNAME
- Name: @ (represents your root domain, e.g., yourdomain.com)
- Target: The destination domain name (e.g., connect.yourservice.com)
- (Note: It should not be a full URL—only a domain name is valid.)
Example Configuration (MilesWeb mPanel):
- DNS Record Type: CNAME
- Name: @
- Target: connect.mileswebapp.com
Once saved, the record may display as ALIAS in the interface to indicate that it’s serving root-level redirection while resolving to the target’s IP address behind the scenes
Configuration Tips
- Use ALIAS if you want your root domain to point to a third-party service.
- For subdomains www, app, and blog, use CNAME.
- Avoid using both records for the same hostname.
- We recommend that you don’t mix CNAME with A, MX, or TXT records on the same subdomain.
- Check TTL settings closely so DNS propagation works as you intended.
How to Confirm Your DNS Setup?
After setting up your CNAME or ALIAS records, confirming that everything resolves correctly is essential. You can check propagation using online tools like DNS Checker.
Steps to Verify:
- Visit DNS Checker.
- Type your full primary domain (ex., yourdomain.com).
- Choose A Record from the dropdown list.
- Hit the Search button.
If configured properly, the tool will return an IP address that should be associated with your domain, and it’s supposed to be the same as the address you are pointing to, like your hosting provider or server.
Pro Tip: If the IP does not match or if there are delays in getting responses from different regions, your changes could still be propagating, or there might be a misconfiguration.