The chief difference between a CNAME record and an ALIAS record is not in the result—both point to another DNS record—but in how they resolve the target DNS record when queried. As a result of this difference, one is safe to use at the zone apex (for example, naked domain such as example.com), while the other is not.
Let’s start with the CNAME record type. It simply points a DNS name, like www.example.com, at another DNS name, like lb.example.net. This tells the resolver to look up the answer at the reference name for all DNS types (for example, A, AAAA, MX, NS, SOA, and others). This introduces a performance penalty, since at least one additional DNS lookup must be performed to resolve the target (lb.example.net). In the case of neither record ever having been queried before by your recursive resolver, it’s even more expensive timewise, as the full DNS hierarchy may be traversed for both records:
Each of these steps consumes at least several milliseconds, often more, depending on network conditions. This can add up to a considerable amount of time that you spend waiting for the final, actionable answer of an IP address.
In the case of an ALIAS record, all the same actions are taken as with the CNAME, except the authoritative server for example.com performs steps six through thirteen for you and returns the final answer as both an IPv4 and IPv6 address. This offers two advantages and one significant drawback:
In most cases, the authoritative servers for example.com will have the answer cached and thus can return the answer very quickly.
The alias response will be A and AAAA records. Since an ALIAS record returns the answer that comprises one or more IP addresses, it can be used anywhere an A or AAAA record can be used—including the zone apex. This makes it more flexible than a CNAME, which cannot be used at the zone apex. The flexibility of the Alias record is needed when your site is posted on some of the most popular CDNs that require the use of CNAME records if you want your users to be able to access it via the naked domain such as example.com.
Since it is the authoritative server for example.com that is issuing the queries for lb.example.net, then any intelligent routing functionality on the lb.example.net record will act upon the location of the authoritative server, not on your location. The EDNS0 edns-client-subnet option does not apply here. This means that you may be potentially mis-routed: for example, if you are in New York and the authoritative server for example.com is in California, then lb.example.com will believe you to be in California and will return an answer that is distinctly sub-optimal for you in New York. However, if you are using a DNS provider with worldwide pops, then it is likely that the authoritative DNS server will be located in your region, thus mitigating this issue.
One important thing to note is that NS1 collapses CNAME records, provided that they all fall within the NS1 system. NS1’s nameservers are authoritative for both the CNAME and the target record. Collapsing simply means that the NS1 nameserver will return the full chain of records, from CNAME to final answer, in a single response. This eliminates all the additional lookup steps and allows you to use CNAME records, even in a nested configuration, without any performance penalty.
And even better, NS1 supports a unique record type called a Linked Record. This is basically a symbolic link within our platform that acts as an ALIAS record might, except with sub-microsecond resolution speed. To use a Linked Record, simply create the target record as you usually would (it can be of any type) and then create a second record to point to it and select the Linked Record option. Note that Linked Records can cross domain (zone) boundaries and even account boundaries within NS1 and offer a powerful way to organize and optimize your DNS record structure.
CNAME | ALIAS | Linked Record | |
Use at Apex? | No | Yes | Yes (only to other NS1 zones) |
Relative Speed (TTFB) | Fast | Faster | Faster |
Collapses Responses | Yes (NS1 Connect exclusive feature) | Yes | Yes |
Discover how separating DNS from your CDN can lead to improved performance, cost savings and resilience. Learn why managing DNS independently allows more control over traffic steering, performance monitoring and resilience across multiple CDN providers.
Selecting the right DNS provider is crucial for managing traffic, ensuring resilience and optimizing performance. Discover the 4 essential factors you must consider, from risk profile and developer needs to managing multiple CDNs and performance requirements.
Learn how managed DNS enhances performance and security, reduces latency and streamlines your operations. Discover the differences between managed and self-managed DNS, and explore the key benefits for your business.
Explore the benefits and challenges of self-hosting authoritative DNS for large enterprises. Learn about the hidden complexities of self-hosting and why managed DNS solutions might be the better choice for scalability, resilience and cost-efficiency.
IBM NS1 Connect is a fully managed cloud service for enterprise DNS, DHCP, IP address management and application traffic steering.
Cloud networking solutions from IBM provide high-performing connectivity to power your apps and business.
Consolidate datacenter support with IBM Technology Lifecycle Services for cloud networking and more.
IBM web domains
ibm.com, ibm.org, ibm-zcouncil.com, insights-on-business.com, jazz.net, mobilebusinessinsights.com, promontory.com, proveit.com, ptech.org, s81c.com, securityintelligence.com, skillsbuild.org, softlayer.com, storagecommunity.org, think-exchange.com, thoughtsoncloud.com, alphaevents.webcasts.com, ibm-cloud.github.io, ibmbigdatahub.com, bluemix.net, mybluemix.net, ibm.net, ibmcloud.com, galasa.dev, blueworkslive.com, swiss-quantum.ch, blueworkslive.com, cloudant.com, ibm.ie, ibm.fr, ibm.com.br, ibm.co, ibm.ca, community.watsonanalytics.com, datapower.com, skills.yourlearning.ibm.com, bluewolf.com, carbondesignsystem.com, openliberty.io