A Record vs. CNAME: What’s the difference (and when to use each)?

Confused about DNS records? Understand when to use A records vs CNAMEs with examples and practical scenarios.
CNAME or A Record DNS

DNS records are like the internet’s address book—they tell browsers and email servers where to find your domain. While these are two of the most common DNS record types you’ll work with, choosing between an A record and a CNAME isn’t always straightforward.

Sure, you could just copy and paste what someone tells you to use, but understanding the difference helps you make smarter choices for your domain setup. Plus, getting it wrong can lead to everything from email delivery problems to website downtime.

A records and CNAMEs each have their sweet spots. An A record is like giving someone your exact street address, while a CNAME is more like telling them “I live at the same place as my roommate.” Both get people to your door, but they work better in different situations.

Below, we’ll walk through exactly when to use each one, show you some real-world examples, and help you avoid the common mistakes that can mess up your domain configuration. Whether you’re setting up email authentication, connecting to a CDN, or just trying to get your website running smoothly, you’ll know exactly which record type to choose.

What is an A record?

An A record (Address record) is a fundamental DNS record type that maps a domain name directly to an IPv4 address. It creates a straight connection between your domain name and the specific IP address where your website or service is hosted.

Think of it like a direct phone line. When someone types your domain into their browser, an A record tells them exactly which IP address to connect to (no middleman, no redirects, just straight to the source). It’s the most basic and direct way to say “Hey, this domain lives at this specific IP address.”

Here’s what makes A records special:

  • They only point to IP addresses, not other domain names
  • You can have multiple A records for the same domain (great for load balancing)
  • They’re usually the fastest DNS record type since there’s no extra lookup needed
  • Most root domains (like example.com) require an A record rather than a CNAME

Let’s look at what an A record actually looks like:

example.com.    IN    A    192.0.2.1

Here’s what those elements mean:

  • example.com is your domain name
  • IN means internet (yes, it’s always there)
  • A shows it’s an A record
  • 192.0.2.1 is the IPv4 address which your domain points to

When setting up your domain, you’ll typically need an A record for your root domain (sometimes called the apex domain). Even if you use CNAMEs for subdomains, the main domain usually needs an A record to function properly.

What is a CNAME record?

A CNAME (Canonical Name) record is a DNS record type that maps one domain name to another domain name. This creates an alias that points to the “true” or canonical domain name rather than directly to an IP address.

Think of a CNAME like call forwarding. Instead of giving out a direct number (like with an A record), you’re saying “when someone calls this number, forward them to that other number.” CNAMEs work the same way. They tell DNS lookups to go check another domain name for the actual address.

Here’s what makes CNAMEs special:

  • They point to other domain names, not IP addresses
  • They’re perfect for services that might change their IP addresses
  • You can update one main record, and all CNAMEs follow automatically
  • They’re commonly used for subdomains and cloud services

Here’s what a CNAME record looks like:

blog.example.com.    IN    CNAME    example.netlify.app.

Breaking this down:

  • blog.example.com is your subdomain
  • IN means internet (standard stuff)
  • CNAME shows it’s a CNAME record
  • example.netlify.app is the destination domain name

CNAMEs are super handy when you’re working with cloud services or CDNs. Instead of managing multiple IP addresses that might change, you just point your CNAME to their domain, and they handle the rest. It’s like having a permanent forwarding address—no matter where the service moves, your CNAME keeps pointing to the right place.

Note: You can’t use a CNAME for your root domain (like example.com) if you need other DNS records there (like MX records for email). This is known as the “CNAME at apex” problem, and it’s one of the main reasons you need to understand when to use each record type.

A record vs. CNAME: What’s the difference?

The main difference between A records and CNAMEs is their function: A records point directly to IP addresses, while CNAMEs point to other domain names. Still, the real differences show up in how they work in practice.

Here’s what that means in DNS terms:

FeatureA RecordCNAME
Points toIP address (like 192.0.2.1)Another domain name
DNS lookupsSingle lookupAt least two lookups
Root domain useYesNo (with some exceptions)
IP changesNeed manual updatesUpdates automatically
Email setupWorks with MX recordsCan cause conflicts

Speed and performance

A records usually perform better because they need just one DNS lookup. CNAMEs require at least two: one to find the CNAME, and another to find the final IP address. It’s a small difference, but it adds up when you’re handling lots of traffic.

Flexibility vs. control

A records give you direct control but need manual updates if IP addresses change. CNAMEs are more flexible with changing IPs, but give up some control to another domain.

Common gotchas

You can’t use a CNAME on your root domain if you need MX records for email. Also, multiple CNAMEs can create a chain of lookups, slowing things down. However, A records need updates when IP addresses change, which can be a pain with cloud services.

The best choice depends on your specific needs. If you need direct control and best performance, go with an A record. If you need flexibility and automatic updates (especially with cloud services), a CNAME might be your better bet.

How to choose the right record type

The choice between an A record and a CNAME often comes down to your specific situation. Instead of giving you a long list of technical criteria, let’s walk through some common scenarios to make this super practical.

Use an A record when:

  1. You’re setting up a root domain
    • Your main domain (example.com) usually needs an A record
    • You need MX records for email on the same domain
    • You want the fastest possible DNS resolution
  2. You have a static IP that rarely changes
    • Your own web server with a fixed IP
    • Self-hosted services
    • On-premise applications
  3. You need load balancing
    • Multiple A records can point to different IPs
    • Great for distributing traffic across servers
    • Perfect for high-availability setups

Use a CNAME when:

  1. You’re working with cloud services
    • Setting up Netlify, Vercel, or similar platforms
    • Using CDNs like Cloudflare or Akamai
    • Connecting to SaaS platforms
  2. You’re managing subdomains
    • blog.example.com
    • shop.example.com
    • app.example.com
  3. The destination IP might change
    • Cloud-hosted services
    • Dynamic infrastructure
    • Third-party services

Make the right DNS choice for email authentication

A records and CNAMEs play important roles in your overall DNS setup, but email authentication often needs special consideration.

For example, when you’re implementing DMARC with Valimail, you’ll need to set up specific DNS records. Getting these right guarantees your email authentication works correctly and keeps domain impersonators at bay. Fortunately, Valimail’s platform handles the complexity of DNS record management for you by automatically creating and updating the records you need.

Get started for free with Valimail Monitor and learn how Valimail automates your DNS record management for email authentication.

Whether you’re using A records, CNAMEs, or a mix of both, getting your DNS setup right is non-negotiable for email security. And with Valimail, you don’t have to figure it out alone.

Get started for free
with Monitor

Start your path to DMARC enforcement with a panoramic view of the traffic being sent on your behalf.
No trial offers, credit cards, or obligations.

Explore all Valimail
has to offer

Go one step further than visibility…Take action! Reach DMARC enforcement faster. Stay compliant with evolving sender requirements. All while protecting your brand.

[UPCOMING WEBINAR] Valimail Product Release: Get Better Brand Protection and Brand Impressions – Register HERE