What Are CNAME Records? The Key to Seamless Domain Management

What Are Cname Records

Have you read William Shakespeare’s Romeo and Juliet? If you have, Juliet’s “What’s in a name” soliloquy is probably etched in your brain — Shakespeare was a wordsmith. While you might find it difficult to understand everything he writes, Juliet’s soliloquy from the tragic love story is straightforward:

“What’s in a name? That which we call a rose

By any other name would smell as sweet.”

I’m going to start calling a rose a “thornveil.” In the Domain Name System (DNS), a Canonical Name (CNAME) record is like a thornveil — it smells just as sweet as a rose.

A CNAME is a type of DNS record that allows you to point multiple domain names (aliases) to a target domain (the canonical name).

In this context, the canonical name is the primary, official domain name for a website, so don’t confuse the two terms. I like to keep my introductions short and as sweet as thornveils, so let’s move on to the not-so-thorny flesh of this article.

CNAME and the Domain Name System

If you don’t know what the Domain Name System is, you’re in luck, as I can explain it to you.

The DNS is like the internet’s phone book — it “converts” easy-to-remember domain names into computer-understandable IP addresses.

Just at the Dewey Decimal System maps numbers to books, the DNS maps domain names to IP addresses

So, when you type a website name into your browser, the DNS pulls strings behind the scenes to find the exact location of the website.

What Are DNS Records?

Let’s take things up a notch. The Domain Name System is a modern phone book and DNS records are like the entries in it. Just like a modern phone book has entries like name, phone number, email address, and address, the DNS has the following records:

  • A record: Maps a domain name to an IPv4 address.
  • AAAA record: Maps a domain name to an IPv6 address.
  • CNAME record: Aliases one domain to another.
  • TXT record: Verifies domain ownership.

Obviously, A records and AAAA records are the most important, as they store the correct IP address for a domain name. CNAME records are a rank lower in priority, but are by no means dispensable.

How Do CNAME Records Work?

Let’s say the canonical address (official address) of your website is example.com, and you have alias domain names such as www.example.com, example.net, and example.org.

Thanks to CNAME records, if one of your users types an alias domain into their browser, the content of the canonical address will load on their screen.

Here’s how this works:

  • Let’s say you type www.example.com into your computer’s browser.
  • Your computer asks the DNS resolver (which performs the “conversion”) to look up the corresponding IP address.
  • The DNS resolver first checks if the domain has a CNAME record.
  • If it does, the resolver follows the “footprints” to the canonical domain name (example.com).
  • The resolver then checks for the A record or AAAA record of the official domain.
  • Once it finds the website’s IP address, your device connects to the server hosting the website.

All these steps happen in the blink of an eye. In case you’re wondering, some examples of DNS resolvers include Google Public DNS and Cloudflare DNS.

Your home router is a type of DNS resolver as well, but it doesn’t resolve IP address lookup queries on its own — it forwards these queries to recursive DNS resolvers like Google Public DNS and Cloudflare DNS.

Common Uses of CNAME Records

Have you heard of domain flipping? Basically, if you buy the right domain name at a low price, you could sell it for a higher price in the future.

This is exactly what a Delhi-based app developer hoped for when he bought the JioHotstar.com domain in September 2023. He must have grinned from ear to ear when he heard of the merger between Mukesh Ambani-led Reliance Industries and Disney+ Hotstar in February 2024.

After a long legal dispute, he sold the rights to the domain name to two Dubai-based siblings, for around $118,000. Quite the twist in the tale.

Domain Alias Management

If only either of the companies I mentioned had the foresight to register JioHotstar.com as an alias!

While domain alias management might not seem important to a budding business, you may end up learning things the hard way (like Reliance Industries and Disney did).

Of course, you can’t purchase every relatable domain name out there, but you should do the bare minimum. For example, redirecting www.example.com to example.com should be one of your priorities.

Third-Party Services

Personalization is a pillar of modern marketing.

If you have subdomains that connect to third-party services such as Shopify and WordPress, their default URLs might be in the format shop.myshopify.com and myblog.wordpress.com, respectively — they don’t keep your brand’s identity intact.

You could use CNAME records to point subdomains like shop.example.com and blog.example.com to these services, respectively. Magical.

Simplifying DNS Management

Now, this use case is dope. Since the subdomains from the above example point to external services, they’re just aliases — they don’t have their own IP addresses.

The services they point to have IP addresses.

This means you don’t have to maintain A records for each subdomain. So, CNAME records make DNS management a lot easier.

Benefits of Using CNAME Records

You can think of alias domains as synonyms for the canonical domain.

Just like using synonyms helps you avoid repeating the same word and express your ideas with improved clarity and precision, with CNAME records, you can avoid repetitive configuration of multiple DNS records. You can precisely point multiple aliases or subdomains to a target domain or service, respectively.

Here’s a list of all the benefits of using CNAME records:

  • Simplifies domain management: Points multiple domain names to a single canonical domain.
  • Reduces the risk of DNS misconfigurations: Changes to the canonical domain reflect across all aliases.
  • Flexible integration with third-party platforms: Easily integrates with services like email, content delivery networks (CDNs), and cloud hosting.
  • Easier updates: Changes to the canonical domain automatically apply to aliases.

Another benefit from a marketing standpoint is improved Search Engine Optimization (SEO) and branding. If you’re a marketing person, using CNAME records can improve your website’s visibility and brand visibility — get in touch with your tech team today.

Note: When you point a subdomain to a third-party service (like Amazon Web Services (AWS)) using a CNAME record, the third-party website becomes the canonical domain.

Limitations and Best Practices for CNAMEs

CNAMEs are a handy tool in DNS management. While they’re great for redirecting traffic or integrating with third-party platforms, you could run into performance issues if you don’t learn how to use them efficiently.

For instance, if you go overboard with chaining (CNAME1 ⇾ CNAME2 ⇾ CNAME3), your website could slow down — each link in the chain adds to the lookup time.

With an understanding of these CNAME limitations and best practices, I’m confident you’ll use CNAME records strategically.

Limitations

I’ve already introduced the subject, so let’s not waste time. It’s crucial in IP address lookups, after all. There are three limitations for CNAMEs. Let’s explore them.

  1. If you set up a CNAME record for www.example.com, for instance, you can’t have any other DNS record for the domain. Yes, CNAMEs are picky, just like my girlfriend.
  2. Each time a CNAME is queried, the DNS resolver needs to perform an additional lookup to resolve to the final IP address. And you know what this means — more time.
  3. This one’s kind of self-explanatory — you can’t use CNAME records for root domains (such as example.com).

Of these limitations, the only major one is the second — avoid excessive chaining.

Best Practices

Speaking of chaining, while a chain necklace looks better with more links, your website doesn’t — the fewer the CNAME links, the better.

To put it into perspective, each additional lookup could add as much as 10-50ms to the query. Be smart and use CNAMEs strategically for aliases and third-party integrations.

Don’t overcomplicate things. I mean, this has to be one of the simplest technologies I’ve ever written about!

How to Set Up a CNAME Record

If you’re shopping for a new website, GoDaddy is the Amazon of the domain registration world — it manages more than 82 million domains. I’ll show you how to set up a CNAME using GoDaddy. Let’s get cracking!

Setting Up a CNAME Using GoDaddy

Taking GoDaddy as a reference point, here’s a step-by-step guide to setting up a CNAME record for example.com:

  • Log into your GoDaddy account.
  • Access the domain management interface by clicking on “My Products,” followed by “Domains.
  • Click the “DNS” button next to the domain for which you want to add a CNAME record.
  • You’ll now see a list of your Domain Name System records. Scroll to the “Add” option and select “CNAME” from the drop-down list.
  • In the “Host” field, enter the alias domain: www (you don’t have to write www.example.com).
  • In the “Points to” field, enter the canonical domain: example.com.
  • In the “TTL” (Time To Live) field, I suggest keeping the default value of one hour or 3600 seconds.

This is what the CNAME configuration looks like:

TypeHostPoints toTTL
CNAMEwwwexample.com1 Hour

Don’t forget to save all the changes. It might take up to 48 hours for the changes to propagate across the internet. Simple as that. You can use tools like dig command online DNS checkers to test and verify the record’s functionality.

Real-World Examples of CNAME Applications

Let’s talk about one of the realest real-world examples of CNAME applications: custom email addresses.

I’m sure you’ve received your fair share of fake job offers. I think I’ve received about 1,000 this year alone (this is by no means a brag). They craft their job offers with guile but miss out on the most important detail — the professionalism of a custom email address.

I’m more likely to respond to an email whose sender format is yourname@example.com rather than yourname@gmail.com! Step up your game, people! Jokes aside, if you want to level up your digital presence, you need a custom email.

CNAME for Email: What’s the Deal?

If you want to map custom domains for email services like Google Workspace and Microsoft 365, MX records, TXT records, and CNAME records come into play.

Let’s take the example of Google Workspace:

  • MX records are the top dog when you’re setting up custom email with Google Workspace. They tell the internet where to send your email. All you have to do is copy the set of MX records Google Workspace gives you when you sign up for their services into your domain’s DNS settings.
  • Google will also give you a TXT record for domain verification. Copy, paste, boom. Also, you can use TXT records to set up email security (SPF and DKIM).
  • Finally, CNAME records are great for aliasing and brand consistency. For example, if you want to receive emails at both yourname@example.com and yourname@mail.example.com, you can set up a CNAME for it. That way, if someone sends you an email at either address, you’ll receive them.

CNAME records are fun to play with, so knock yourself out! Just be careful.

Troubleshooting Common CNAME Issues

Are you a good cook? Making a creamy omelet is easier than it may seem — just watch a YouTube tutorial with over one million views and turn on your stove!

Setting up a CNAME record is as easy as making an omelet, but sometimes things don’t go as planned. You may be left with a burned egg! While I can’t help you master omelet-making (you’ll get it right eventually), I can help you troubleshoot common CNAME issues. Let’s do it.

“CNAME Record Not Found”

First things first, if you’re getting a “CNAME Record Not Found” error, and it hasn’t been 48 hours since you set up the record, don’t panic. It usually takes up to 48 hours for DNS settings to fully propagate.

If the error persists, you’re allowed to panic a little. I’m kidding — I’ve got your back. Double-check your DNS settings and make the necessary changes.

Redirection Loops

Have you watched Inception? If you’re stuck in a redirection loop, congratulations, you’ve created your very own Inception-like situation. Christopher Nolan would be proud.

This error usually means the CNAME is misconfigured and pointing to a domain that redirects back to itself. Again, double-check your DNS settings. Take a look at the “Points to” field, in particular, and make sure it’s correct.

Tips and Tools for Troubleshooting

If you’re stuck and have lost all hope, you could turn to YouTube and learn how to make an omelet. Or, er… use a DNS lookup tool to see exactly where your CNAME record is pointing.

Online diagnostic platforms like MXToolbox and What’s My DNS are quite helpful as well and can identify issues in real time. I’m not judging you, but you seriously shouldn’t be getting CNAME configurations wrong!

What’s In a C“NAME”?

I’m nowhere near as crafty as Shakespeare, but hey, you’ve got to give me some credit for my wordplay! What’s in a C”NAME”? A lot.

If you don’t configure the CNAME record for your website, anyone who visits www.example.com instead of example.com, for instance, will not be redirected to your website.

While I understand why you feel this should be configured by default, it’s not. And this is just the simplest example of how you can use CNAME records for your benefit.

Properly configure all your DNS records and make sure you check them every time you make significant changes to your website. I recommend purchasing a few of the most relatable domains for your website — you never know when they might come in handy.

Happy domain flipping!