Search code examples
dnsaws-cloudformationamazon-route53

When would you choose Route 53 Alias over CNAME?


I'm trying to figure out if I should use Route 53 Alias functionality or CNAME for a domain pointing to an aws load balancer.

Based on their documentation, an advantage of this is you can use Alias on the zone apex.

However, I don't intend to use it at that level. Just via sub domains (subdomain.example.com). In this use case, do I just use CNAME?

One down side I imagine is the fragility of the Route 53 DNS Alias entries. I'm configuring this via cloudformation, and I realize if a load balancer or whatever aws resource behind the Alias Target cease to exist, the cloudformation template will stop break as well.

This is painful in situations when you just want to add a new record for something else, then you can't because a previously configured Alias no longer exists.


Solution

  • I think that you already know the basic differences between ALIAS and CNAME as you pointed out apex domain and their docs. For completeness I will also add the link below:

    One big advantage of ALIAS over CNAME, which you may not know (not written in your question) is that ALIAS record is free. For non ALIAS records you have to pay. ALIAS queries are free:

    Queries for qualifying alias records are provided at no additional cost to Route 53 customers.

    The issue you describe with CloudFormation breaking, applies to any record. Alias is not an exception. What's more this applies to any resource created in CFN. If you create some resources in CFN, and the modify/delete them outside of your CFN then you put yourself in troubles of having inconsistent stack.