CNAME records are DNS records that point one hostname to another hostname instead of directly to an IP address. They are commonly used when a service provider gives you a target host name rather than an IPv4 or IPv6 address, or when you want multiple subdomains to follow the same destination. For Apexhost customers, CNAME records are often used for website aliases such as www, Microsoft 365 and Google Workspace service records, email verification, third-party platform connections and other hosted services.
Understanding how a CNAME record works can help you make DNS changes more confidently and avoid common setup mistakes. This article explains what a CNAME record is, when to use it, how it differs from other DNS record types, and what to check when a CNAME record does not work as expected.
What a CNAME record does
DNS, or Domain Name System, is the system that helps browsers and internet services find the correct destination for a domain or subdomain. Some DNS records point directly to an address, while others point to another host name. A CNAME record belongs to the second group.
CNAME stands for Canonical Name. In practical terms, it creates an alias from one host name to another host name. When someone looks up the alias, DNS follows the CNAME to the destination host and then resolves that destination using its own DNS records.
In simple terms, a CNAME record tells one host name to use the DNS destination of another host name.
For example, if www.example.com has a CNAME record pointing to hosting.provider.com, a visitor who enters www.example.com will be directed according to the DNS records of hosting.provider.com.
When to use a CNAME record
A CNAME record is useful when the service you are connecting to gives you a host name rather than an IP address. This is common with cloud platforms, external website services, verification systems and some email-related services.
Common use cases include:
-
Pointing
wwwto another host name -
Connecting a subdomain to a third-party website platform
-
Adding Microsoft 365 or Google Workspace service-related host aliases
-
Creating verification records for SaaS platforms
-
Pointing a service host name to infrastructure managed by another provider
A CNAME record is usually best suited to subdomains such as www.example.com, mail.example.com or status.example.com.
CNAME records compared with other DNS records
It is important to choose the correct DNS record type for the service you are configuring.
An A record points a host name directly to an IPv4 address.
An AAAA record points a host name directly to an IPv6 address.
A CNAME record points a host name to another host name.
An MX record controls incoming email routing for a domain.
A TXT record stores text-based information used for verification, SPF, DKIM, DMARC and other services.
If your provider gives you a numeric IP address, you will usually need an A record or AAAA record rather than a CNAME record. If your provider gives you a destination such as ghs.googlehosted.com or another fully qualified host name, a CNAME record may be the correct choice.
Important notes before creating a CNAME record
Before adding or changing a CNAME record, keep the following points in mind.
* A CNAME record points to a host name, not directly to an IP address.
* A CNAME record is normally used for a subdomain rather than the root domain.
* Some DNS providers do not allow a CNAME record at the root domain such as example.com.
* A host name that uses a CNAME record should not usually have conflicting records of other types with the same name.
* If the destination host name changes at the provider side, your alias will follow it automatically as long as the provider maintains correct DNS.
* DNS changes may take time to appear due to caching and propagation.
Before you change DNS
Make sure you have the following information before you begin.
* The full domain or subdomain you want to update
* Access to the control panel where the active DNS zone is hosted
* The exact CNAME target supplied by your provider
* A record of the current DNS settings in case you need to revert the change
* An understanding of whether the change may affect your website, email or connected services
If you are unsure where DNS is currently hosted, check the domain’s active nameservers first. Updating the wrong control panel will not change live DNS.
How to create or update a CNAME record
The exact steps vary depending on where your DNS is hosted, but the general process is similar across most platforms.
1. Log in to the control panel that manages the active DNS zone for your domain.
2. Open the DNS management area for the relevant domain. This may be labelled DNS, Zone Editor, DNS Zone Records or similar.
3. Locate the option to add a new DNS record or edit an existing one.
4. Select CNAME as the record type.
5. In the record name or host field, enter the subdomain you want to point. For example, enter www if you want to point www.example.com.
6. In the destination, target or points to field, enter the host name supplied by your provider.
7. If a TTL field is shown, leave the default value unless your provider has given a specific requirement.
8. Save the record.
9. Allow time for DNS propagation, then test the service again.
If you are following provider-specific instructions, copy the supplied values exactly. A small typing error can prevent the record from working.
Example of how a CNAME works
Suppose you want www.example.com to use the same destination as a hosting platform that gives you the target sites.provider.net.
You would create a CNAME record so that:
* www.example.com points to sites.provider.net
When DNS is queried for www.example.com, it follows the alias to sites.provider.net and then uses the DNS records for that destination host.
TTL and DNS propagation
TTL stands for Time To Live. It tells DNS resolvers how long they can cache a record before requesting a fresh copy. A shorter TTL may allow changes to be seen sooner by some resolvers, while a longer TTL may reduce lookup frequency.
Even after you save a new CNAME record, not every user will see the change immediately. DNS propagation is the general term used to describe the time it takes for cached results across different networks and resolvers to refresh.
Propagation time varies depending on the previous TTL, the resolver being used, local device caching and the DNS provider. Because of this, a change may appear correct from one network while another still sees the old destination for a period of time.
Common mistakes to avoid
* Entering an IP address instead of a host name
* Updating DNS in a control panel that is not authoritative for the domain
* Creating a CNAME record where another conflicting record already exists for the same host name
* Using the root domain where the DNS provider does not support CNAME at the apex
* Typing the target host name incorrectly
* Expecting DNS changes to apply instantly everywhere
* Confusing CNAME records with A, AAAA, MX or TXT records
Troubleshooting
The subdomain is still loading the old destination
This usually means DNS caching is still in effect somewhere between the DNS provider, internet service provider, local network or device.
Check that the CNAME record was saved in the correct DNS zone, confirm the target host name is correct, and allow additional time for propagation.
The subdomain does not load after creating the CNAME record
This may happen if the target host name is incorrect, the provider has given different setup instructions, or the destination service has not been configured to recognise your domain or subdomain.
Review the current CNAME value, compare it with the provider’s instructions, and confirm that the external service is ready to respond for your host name.
The wrong control panel is being updated
If the domain uses external nameservers or another DNS host, changes made in a local hosting panel may not affect live DNS.
Check which nameservers are active for the domain and confirm where the authoritative DNS zone is managed before making further changes.
The provider says the record is incorrect even though it looks right
Some DNS providers automatically append the root domain to the host field. This can cause the record name to be entered incorrectly if the full domain is pasted into a field that expects only the host portion.
Review the provider’s expected format carefully. If the instructions say to enter only the host part, do not duplicate the domain name.
I need to point a domain to an IP address
If the destination is a direct IPv4 or IPv6 address rather than another host name, you may need an A record or AAAA record instead of a CNAME record.
Frequently asked questions
Can I use a CNAME record for the root domain?
Not always. Many DNS providers do not allow a CNAME record at the root domain, also called the apex domain. In those cases, another record type or provider-specific solution may be required.
What is the difference between a CNAME record and an A record?
A CNAME record points to another host name. An A record points directly to an IPv4 address.
Can I have other records with the same name as a CNAME record?
In normal DNS practice, a host name using a CNAME record should not also use other conflicting record types with the same name.
Does changing a CNAME record affect email?
Not directly in most cases, unless the changed host name is used by an email-related service. Incoming mail routing usually depends on MX records.
Should I use a CNAME record for www?
Often, yes. Many DNS setups use a CNAME record for www so it follows another host name. The correct design depends on your hosting platform and DNS requirements.
Related Articles
-
What is DNS? (DNS)
-
A Records (DNS Records)
-
AAAA Records (DNS Records)
-
MX Records (DNS Records)
-
TXT Records (DNS Records)
-
How to create DNS records (SRV etc) for Office 365
Need More Help?
If you require further assistance, please contact Apexhost Support at support@apexhost.com.au.
