Hosting & Deployment

How to Configure CNAME Records: 7 Proven Easy Steps

0

How to Configure CNAME Records is an important skill for website owners, developers, freelancers, and IT administrators who manage domains and DNS settings. A CNAME record allows one hostname to point to another hostname instead of directly pointing to an IP address.

CNAME records are commonly used for subdomains, website platforms, content delivery networks, email services, verification systems, and third-party applications. For example, www.example.com can be configured as a CNAME pointing to example.com or to a hostname supplied by a hosting provider.

Learning How to Configure CNAME Records is relatively simple once you understand DNS, hostnames, target values, and the difference between CNAME and other DNS record types.

In this beginner-friendly tutorial, you will learn How to Configure CNAME Records step by step. We will explain what CNAME records are, how they work, when to use them, how to add them in cPanel and Cloudflare, how to connect third-party services, how to verify changes, and how to troubleshoot common CNAME errors.

How to Configure CNAME Records

What Is a CNAME Record?

Before learning How to Configure CNAME Records, it is important to understand what CNAME means.

CNAME stands for Canonical Name. A CNAME record creates an alias from one DNS name to another DNS name.

For example:

www.example.com
        ↓
CNAME
        ↓
example.com

This means that www.example.com is an alias for example.com.

Another common example is connecting a subdomain to a third-party service:

blog.example.com
        ↓
CNAME
        ↓
example.hosting-platform.com

The target is a hostname rather than an IP address.

The IETF DNS documentation provides the technical foundation for DNS concepts, including canonical names and aliases.

Understanding this basic relationship is the foundation of How to Configure CNAME Records.

Why Are CNAME Records Important?

Learning How to Configure CNAME Records is useful because CNAME records allow domain administrators to connect hostnames to other hostnames without manually maintaining IP addresses.

CNAME records are commonly used for:

  • www subdomains
  • Blog subdomains
  • SaaS applications
  • Website builders
  • CDN services
  • Domain verification
  • Email-related services
  • Marketing platforms
  • Application hosting
  • Third-party integrations

For example, a hosting provider may give you:

Target:
customer.example-host.com

and ask you to create:

blog.example.com

as a CNAME pointing to that target.

How Does a CNAME Record Work?

The basic process looks like this:

User
  ↓
www.example.com
  ↓
DNS Lookup
  ↓
CNAME
  ↓
example.com
  ↓
IP Address
  ↓
Web Server

The CNAME points the requested hostname to another hostname.

The DNS system can then continue resolving the target hostname.

For example:

www.example.com
       ↓
CNAME example.com
       ↓
A 203.0.113.10

The CNAME itself does not contain the web server’s IP address.

This is one reason How to Configure CNAME Records is different from configuring an A record.

CNAME vs A Record

Beginners often confuse CNAME and A records.

A Record

An A record maps a hostname directly to an IPv4 address.

Example:

example.com → 203.0.113.10

CNAME Record

A CNAME maps one hostname to another hostname.

Example:

www.example.com → example.com

Here is a simple comparison:

FeatureA RecordCNAME Record
Points toIPv4 addressHostname
Example203.0.113.10server.example.com
Common useRoot domain/serverSubdomains/aliases
Direct IP mappingYesNo

Understanding this difference is essential when learning How to Configure CNAME Records.

CNAME vs MX Record

CNAME records and MX records also have different purposes.

An MX record determines where email for a domain should be delivered.

A CNAME creates a DNS alias.

For example:

CNAME:
www.example.com → example.com

while:

MX:
example.com → mail.example-provider.com

Do not replace an MX record with a CNAME.

[Internal link: How to Configure MX Records for Email]

What Do You Need Before Configuring a CNAME Record?

Before starting How to Configure CNAME Records, collect the following:

  • Domain name
  • DNS management access
  • Hostname or subdomain
  • Target hostname
  • Service provider instructions
  • Existing DNS records

For example, a third-party platform might tell you to create:

Type: CNAME
Name: blog
Target: example.platform.com

Your final DNS entry may become:

blog.example.com → example.platform.com

Always use the exact target provided by your service provider.

Do not guess the target hostname.

Step 1: Find Your DNS Provider

The first step in How to Configure CNAME Records is finding where your DNS is managed.

Your domain registrar, website host, and DNS provider can be different companies.

For example:

Domain Registrar → Company A
DNS Provider → Cloudflare
Website Hosting → Company B
Email Provider → Company C

In this example, CNAME changes must be made in Cloudflare.

Log in to the provider managing your DNS.

Look for options such as:

DNS Management
DNS Records
Manage DNS
Zone Editor
DNS Zone

You should see records such as:

A
AAAA
CNAME
MX
TXT
NS

If you cannot find your DNS records, check which nameservers are assigned to your domain.

Step 2: Decide Which Hostname You Need

Before adding a CNAME, determine which hostname you want to configure.

For example:

www.example.com
blog.example.com
shop.example.com
app.example.com

Suppose you want:

blog.example.com

to point to:

myblog.platform.com

You would create:

Type: CNAME
Name: blog
Target: myblog.platform.com

Your DNS provider may automatically append the domain name.

Therefore, you usually enter:

blog

rather than:

blog.example.com

However, DNS interfaces differ, so follow your provider’s input format.

Step 3: Get the CNAME Target From Your Provider

The next step in How to Configure CNAME Records is obtaining the correct target hostname.

A third-party service may provide something like:

CNAME Target:
customer.service-example.com

You should copy this value exactly.

For example:

Name:
store

Target:
customer.service-example.com

This creates:

store.example.com

pointing to:

customer.service-example.com

Never replace a provider’s target with an IP address unless the provider specifically instructs you to do so.

Step 4: Check for Conflicting DNS Records

Before adding the CNAME, check whether another DNS record already uses the same hostname.

For example, if you want:

blog.example.com

to be a CNAME, you should check whether blog already has an:

A record
AAAA record
CNAME record

A hostname generally cannot have a CNAME record alongside other data records at the same name.

For example, this can cause a conflict:

blog.example.com
A      203.0.113.10
CNAME  platform.example.com

If you are intentionally replacing the existing A record, make sure you understand what currently uses it before deleting it.

Checking for conflicts is an important part of How to Configure CNAME Records.

Step 5: Add the CNAME Record

Now open your DNS management panel.

Click Add Record.

Select:

Type: CNAME

Enter the hostname.

For example:

Name: blog

Then enter the target:

Target: customer.platform.com

A typical configuration looks like:

Type: CNAME
Name: blog
Target: customer.platform.com
TTL: Auto

Save the record.

Your final DNS configuration may look like:

blog.example.com
       ↓
CNAME
       ↓
customer.platform.com

This is the central step in How to Configure CNAME Records.

Step 6: Wait for DNS Propagation

DNS changes are not always visible immediately.

After adding a CNAME record, DNS resolvers may continue using cached information according to the record’s TTL.

Some users may see the change quickly, while others may need to wait longer.

Avoid repeatedly deleting and recreating the record because it does not immediately appear in an external DNS checker.

First confirm that the record was saved correctly.

Then allow DNS caches to update.

Step 7: Verify the CNAME Record

After completing How to Configure CNAME Records, verify that the record is publicly visible.

Using dig

On Linux or macOS, run:

dig CNAME blog.example.com

You can also use:

dig +short CNAME blog.example.com

The result should show something similar to:

customer.platform.com.

Using nslookup

On Windows:

nslookup -type=CNAME blog.example.com

The command should return the configured target.

You can also use online DNS lookup tools to check CNAME records.

Verification is important because your DNS control panel showing a saved record does not necessarily mean every public resolver has already updated.

How to Configure CNAME Records for www

One of the most common CNAME configurations is connecting www to the root domain.

For example:

Type: CNAME
Name: www
Target: example.com

This creates:

www.example.com → example.com

The root domain might then have an A or AAAA record:

example.com → 203.0.113.10

This allows both:

https://example.com

and:

https://www.example.com

to reach the same website, depending on your server configuration.

However, DNS alone does not necessarily determine how your website handles the two hostnames. Your web server, application, or hosting platform may also need to be configured for both domains.

How to Configure CNAME Records for a Subdomain

CNAME records are frequently used for subdomains.

For example, you may want:

blog.example.com

to point to a blogging platform.

Your provider may give you:

Target:
customer.blog-platform.com

Add:

Type: CNAME
Name: blog
Target: customer.blog-platform.com

After DNS propagation:

blog.example.com
       ↓
customer.blog-platform.com

This is one of the most common real-world uses of How to Configure CNAME Records.

How to Configure CNAME Records for a Website Builder

Many website builders allow you to connect a custom subdomain.

For example, a platform may ask you to create:

www.example.com

as a CNAME pointing to:

sites.platform-example.com

The general process is:

  1. Log in to your website builder.
  2. Add your custom domain.
  3. Read the DNS instructions.
  4. Copy the CNAME hostname.
  5. Open your DNS provider.
  6. Add the CNAME record.
  7. Save the record.
  8. Return to the website builder.
  9. Verify the domain.
  10. Test the website.

Do not use generic CNAME values from another website. Your platform may provide a unique target for your account.

How to Configure CNAME Records for Cloudflare

If Cloudflare manages your DNS, log in to Cloudflare and select your domain.

Go to:

DNS → Records

Click:

Add record

Select:

Type: CNAME

Enter:

Name: blog
Target: customer.platform.com

Then save the record.

Cloudflare also provides additional settings depending on the record and service.

If the hostname is being used for a service that requires direct DNS resolution, check the provider’s instructions carefully before enabling any proxying feature.

You can read more about CNAME records in Cloudflare’s official DNS documentation.

How to Configure CNAME Records in cPanel

If your DNS is managed through cPanel, open:

cPanel → Domains → Zone Editor

Select your domain.

Click Manage if required.

Find the CNAME section or select Add Record.

Enter the hostname and target.

For example:

Type: CNAME
Name: blog.example.com
CNAME: customer.platform.com

The exact cPanel interface can vary depending on your hosting provider.

Some hosting providers may not allow you to manage DNS directly through cPanel if DNS is hosted elsewhere.

How to Configure CNAME Records for Email Services

CNAME records are sometimes used by email providers for specific services such as:

  • DKIM
  • Domain verification
  • Tracking domains
  • Autodiscover
  • Email security services

For example, an email provider might give you:

Type: CNAME
Name: selector1._domainkey
Target: selector1-example-com.provider.com

In this case, the CNAME is part of the provider’s email authentication setup.

Do not assume that every email-related DNS record should be an MX or TXT record.

The provider will specify the required type.

[Internal link: How to Add DKIM and DMARC Records]

CNAME Records and SSL Certificates

When using a CNAME to connect a subdomain to a third-party platform, HTTPS still needs to be configured correctly.

For example:

blog.example.com
       ↓
CNAME
       ↓
platform.example.com

The third-party platform should support your custom hostname and provide the necessary TLS certificate.

Simply adding a CNAME does not automatically guarantee that HTTPS will work.

After configuring the DNS record, follow the platform’s instructions for SSL or custom-domain activation.

CNAME Flattening and Root Domains

A common question when learning How to Configure CNAME Records is why CNAME records are often used for subdomains instead of the root domain.

Under standard DNS rules, a CNAME cannot coexist with other records at the same name.

The root domain often needs several records, such as:

example.com
A
MX
TXT
NS

Therefore, a traditional CNAME at the root domain would conflict with other required records.

Some DNS providers offer a feature commonly called CNAME flattening or an equivalent mechanism that allows the root domain to behave similarly to a CNAME in certain environments.

The exact implementation depends on the DNS provider.

Do not assume that every DNS provider supports root-domain CNAME behavior.

CNAME Record and DNS TTL

TTL stands for Time to Live.

It tells DNS resolvers how long a DNS record may be cached.

For example:

TTL: 3600

generally means the record may be cached for around one hour.

Some DNS providers use:

Auto

instead of requiring you to enter a numeric TTL.

During migrations, administrators may choose shorter TTL values ahead of planned changes, but this should be done carefully.

Changing the TTL immediately before a DNS change does not guarantee that all existing cached records will disappear instantly.

Common CNAME Errors

When learning How to Configure CNAME Records, you may encounter several common problems.

CNAME Record Not Found

Check:

  • Hostname
  • Target
  • DNS provider
  • Nameservers
  • Record type
  • DNS propagation

CNAME Conflict

A CNAME cannot normally coexist with other DNS records at the same hostname.

Check for an existing A, AAAA, MX, TXT, or other conflicting record.

Website Is Not Loading

A correct CNAME does not necessarily mean the website is fully configured.

Check whether the target service has:

  • Added your domain
  • Verified your domain
  • Enabled HTTPS
  • Configured your hostname

SSL Certificate Error

If the third-party platform has not provisioned an SSL certificate for your custom domain, HTTPS may show a certificate warning.

Check the platform’s custom-domain settings.

DNS Still Shows the Old Value

This may be caused by DNS caching.

Check the authoritative DNS server and allow time for public resolvers to update.

How to Troubleshoot CNAME Problems

If your CNAME does not work, follow these steps.

1. Check the Record

Use:

dig CNAME blog.example.com

or:

nslookup -type=CNAME blog.example.com

2. Check the Nameservers

Make sure you are modifying DNS at the provider that actually manages your domain’s authoritative DNS.

3. Check for Conflicts

Make sure the hostname does not have a conflicting A, AAAA, or other record.

4. Check the Target

Copy the target exactly from your hosting or service provider.

5. Check the Third-Party Service

Make sure the platform recognizes your custom domain.

6. Check HTTPS

Verify that the provider has issued or configured the certificate for your hostname.

7. Wait for DNS Caching

If everything is correct, allow DNS caches time to update.

These steps can resolve most beginner-level problems with How to Configure CNAME Records.

CNAME Records and Domain Verification

Many third-party services use CNAME records to verify domain ownership.

For example, a service may provide:

Name:
verify

Target:
verification.service-example.com

You create:

verify.example.com

pointing to the provided target.

The service then checks DNS to confirm that the record exists.

Domain verification may be required for:

  • Website platforms
  • SaaS applications
  • Email services
  • Analytics tools
  • Marketing platforms
  • Search tools
  • CDN providers

Always remove verification records only after confirming they are no longer required.

CNAME Records and CDN Services

Content delivery networks may use CNAME records to route a subdomain through their infrastructure.

For example:

cdn.example.com
       ↓
CNAME
       ↓
customer.cdn-provider.com

When users request:

https://cdn.example.com/image.jpg

the DNS configuration directs the hostname to the CDN provider.

The CDN can then deliver cached content from locations closer to users.

If you use a CDN, follow the provider’s current DNS and SSL configuration instructions.

CNAME Records and SaaS Applications

Software-as-a-Service platforms commonly use CNAME records for custom domains.

For example, a SaaS provider may ask you to configure:

app.example.com

as:

CNAME → customer.saas-platform.com

The platform then maps the hostname to your account.

The general workflow is:

Create Application
       ↓
Add Custom Domain
       ↓
Receive CNAME Target
       ↓
Add DNS Record
       ↓
Verify Domain
       ↓
Enable HTTPS
       ↓
Test Application

This is another common use case for How to Configure CNAME Records.

CNAME Records and Subdomain Redirects

A CNAME is not an HTTP redirect.

For example:

www.example.com
CNAME
example.com

does not mean that a browser receives an HTTP 301 redirect.

It means DNS resolves the hostname through the target.

If you want users to be redirected from:

www.example.com

to:

example.com

you need web-server or application-level redirect configuration.

This distinction is important for SEO and website management.

SEO Considerations for CNAME Records

CNAME records can affect SEO indirectly when used for website migrations, subdomains, CDNs, or third-party platforms.

After configuring a CNAME, check:

  • HTTPS
  • Canonical URLs
  • Redirects
  • Internal links
  • Page accessibility
  • Robots.txt
  • XML sitemap
  • Duplicate URLs

Remember that a CNAME is a DNS configuration and does not itself create an SEO redirect.

If you are migrating URLs, configure proper HTTP redirects at the web-server or application level.

Common Mistakes Beginners Should Avoid

When learning How to Configure CNAME Records, avoid these mistakes.

Using an IP Address as a CNAME Target

CNAME targets should be hostnames, not IP addresses.

If you need to point directly to an IPv4 address, an A record may be appropriate.

Creating a CNAME Conflict

Do not create a CNAME alongside conflicting records at the same hostname.

Using the Wrong Target

Always copy the target provided by your service provider.

Editing DNS at the Wrong Provider

Check your authoritative nameservers before making changes.

Assuming CNAME Means Redirect

CNAME changes DNS resolution. It does not perform an HTTP redirect.

Forgetting SSL

A custom domain needs proper HTTPS configuration at the destination service.

Changing DNS Without a Backup

Document existing DNS records before making significant changes.

CNAME Security Best Practices

After learning How to Configure CNAME Records, follow these practices:

Use Official Provider Instructions

Only use CNAME targets provided by the service you are configuring.

Protect DNS Access

Use strong passwords and multi-factor authentication where available.

Remove Unused Records

Delete obsolete records after confirming they are no longer needed.

Review Third-Party Services

Old CNAME records may continue pointing to services you no longer use.

Document Your DNS

Keep a record of why each CNAME exists.

Check for Subdomain Takeover Risks

Unused CNAME records pointing to abandoned third-party resources can create security risks in some hosting environments.

When retiring a third-party service, remove or update its DNS records promptly.

CNAME Configuration Checklist

Use this checklist when following How to Configure CNAME Records:

  • Identify your DNS provider
  • Identify the hostname you want to configure
  • Get the target from your service provider
  • Check existing DNS records
  • Look for conflicting records
  • Create the CNAME record
  • Enter the correct hostname
  • Enter the exact target
  • Save the record
  • Wait for DNS caching
  • Verify with dig or nslookup
  • Verify the third-party service
  • Check HTTPS
  • Test the hostname
  • Check redirects if required
  • Remove obsolete records
  • Document the configuration

Frequently Asked Questions

What is a CNAME record?

A CNAME record creates an alias from one hostname to another hostname. It is commonly used for subdomains and third-party services.

How to Configure CNAME Records for a subdomain?

Open your DNS management panel, create a CNAME record, enter the subdomain as the name, and enter the target hostname provided by your service provider.

Can a CNAME point to an IP address?

No. A CNAME points to another hostname. If you need to map a hostname directly to an IPv4 address, an A record is generally used.

Can I have an A record and CNAME for the same hostname?

A CNAME generally cannot coexist with other DNS data at the same hostname. Remove or replace conflicting records only after confirming what they are used for.

Can I use a CNAME for the root domain?

Traditional DNS CNAME rules make root-domain CNAMEs problematic because the root domain normally needs other DNS records. Some DNS providers offer CNAME flattening or similar features.

Does a CNAME redirect visitors?

No. A CNAME changes DNS resolution. It does not create an HTTP redirect.

How long does a CNAME record take to work?

It depends on DNS caching and TTL values. Some changes become visible quickly, while others can take longer.

Can CNAME records be used for email?

Yes, email providers may use CNAME records for services such as DKIM, verification, or tracking. However, MX records are used to specify mail delivery servers.

How do I check a CNAME record?

You can use:

dig CNAME subdomain.example.com

or:

nslookup -type=CNAME subdomain.example.com

Can CNAME records affect SSL?

Yes. If a CNAME connects a custom hostname to a third-party service, that service normally needs to configure an SSL/TLS certificate for the hostname.

Useful External Resources

For DNS concepts and CNAME behavior, see the IETF DNS documentation.

For modern DNS terminology and standards, the IETF RFC 1035 is also a useful technical reference.

For Cloudflare DNS configuration, visit the official Cloudflare DNS documentation.

For domain and DNS configuration, consult the documentation provided by your hosting or DNS provider.

These authoritative resources can help you understand How to Configure CNAME Records and troubleshoot advanced DNS problems.

Conclusion

Learning How to Configure CNAME Records is an important skill for anyone managing websites, domains, SaaS applications, CDNs, and third-party services.

The process is straightforward: identify your DNS provider, determine the hostname you want to configure, obtain the correct target from your service provider, check for conflicting records, add the CNAME, wait for DNS changes to become visible, and verify the result.

Remember that a CNAME points one hostname to another hostname. It does not directly point to an IP address and it does not create an HTTP redirect.

You should also be careful when changing existing DNS records. Document your current configuration, remove obsolete records only when appropriate, and follow the exact instructions provided by your hosting or SaaS provider.

Once you understand How to Configure CNAME Records, you can confidently connect subdomains to website platforms, SaaS applications, CDNs, verification services, and other third-party systems while maintaining a clean and reliable DNS configuration.

How to Configure MX Records for Email: 7 Proven Easy Steps

Previous article

How to Change DNS A Records: 7 Proven Easy Steps

Next article

Comments

Leave a reply

Your email address will not be published. Required fields are marked *