What is a CNAME record?
A practical reference guide to CNAME records, including what the alias target means, common examples, and where CNAMEs can cause confusion.
Tools For This Topic
What a CNAME record is
A CNAME (Canonical Name) record creates an alias from one hostname to another hostname.
Instead of returning an IP address directly, the DNS response points to another hostname, which must then be resolved to its final A or AAAA record.
This introduces an extra lookup step but provides flexibility in how services are mapped.
What a CNAME record looks like
A typical CNAME record maps an alias hostname to a canonical target hostname.
app.yourdomain.com. 300 IN CNAME app-hosting.vendor-platform.net.This means that app.yourdomain.com is an alias for app-hosting.vendor-platform.net, and DNS resolution will continue using the target hostname.
What each field means
- Hostname: the alias name that users or systems query
- TTL: how long resolvers cache the result
- Type: CNAME indicates an alias record
- Value: the canonical target hostname that will be resolved next
How CNAME resolution works
When a resolver queries a CNAME, it receives the alias target instead of an IP address.
The resolver must then perform an additional lookup on the target hostname to retrieve its A or AAAA records.
This chained resolution is why CNAMEs can introduce additional latency if overused.
Why CNAME is useful
CNAME records are widely used with CDNs, SaaS platforms, and cloud services.
They allow you to point a stable, branded hostname at a provider-managed endpoint that may change over time.
This abstraction lets providers move infrastructure or balance traffic without requiring DNS changes on your side.
Important limitations
A CNAME cannot coexist with other record types on the same hostname. If a CNAME exists, no other records (such as A, MX, or TXT) can be defined for that name.
Additionally, CNAMEs cannot be used at the root (apex) of a domain in standard DNS, because the root must support other record types.
Common mistakes
- Trying to use a CNAME alongside conflicting records on the same hostname
- Using a CNAME at the domain apex where it is not supported
- Expecting a CNAME to behave like an A record
- Not accounting for the additional lookup step in performance-sensitive scenarios
- Misunderstanding provider-managed targets that change over time
CNAME vs other record types
CNAME records are fundamentally different from address records. They do not return IP addresses directly.
Instead, they redirect the lookup process to another hostname, which is then resolved normally.
Use These DNS Pro Tools
If you want to validate this topic in practice, these DNS Pro tools are the fastest next step.
Related Tools
Related Articles
What is a DNS record?
A practical reference guide to DNS records, including what they contain, what common fields mean, and how different record types are used in real DNS setups.
How to Check an SPF Record
A practical guide to checking an SPF record, including where to look, how to read includes and qualifiers, and how to spot common SPF problems.
Common PTR Record Problems: Reverse DNS Issues Explained
A practical guide to PTR record problems, including missing reverse DNS, forward-confirmed reverse DNS, hostname issues, and how PTR impacts email deliverability.
