What is cname

Last updated: April 1, 2026

Quick Answer: A CNAME record is a DNS resource record that creates an alias mapping one domain name to another canonical domain name, commonly used for subdomains, content delivery networks, and email hosting.

Key Facts

Understanding CNAME Records

A CNAME (Canonical Name) record is a type of Domain Name System (DNS) resource record that creates an alias for a domain name. Instead of pointing directly to an IP address like A records do, CNAME records point to another domain name. This creates an alias relationship where one domain name becomes an alternative name for another domain.

When a DNS query encounters a CNAME record, it performs an additional DNS lookup on the target domain to find the actual IP address. This means CNAME records provide an indirect routing mechanism in DNS infrastructure, allowing flexibility in domain management.

How CNAME Records Work

When you create a CNAME record, you specify a source domain (typically a subdomain) and a target domain. For example, you might create a CNAME record pointing blog.example.com to blog.example.com.cdn.provider.com. When someone accesses blog.example.com, their DNS resolver follows the CNAME record and looks up the target domain, eventually finding the IP address that provides the content.

This structure allows multiple domains or subdomains to point to the same service without duplicating configuration. If the target domain's IP address changes, all CNAME records pointing to it automatically resolve to the new address, eliminating the need for manual updates.

Common Use Cases

CNAME records are extensively used for Content Delivery Networks (CDNs) like Cloudflare, Akamai, and CloudFront. Websites point subdomains to CDN endpoints using CNAME records, allowing the CDN to serve cached content globally. Email hosting providers use CNAME records to allow users to point their domains to external mail servers. Software-as-a-Service (SaaS) platforms often require customers to create CNAME records pointing to their service, enabling custom domain functionality.

CNAME Limitations and Best Practices

Important limitations include that CNAME records cannot be created for root domains (the bare domain without a subdomain prefix). Only subdomains can have CNAME records; the root domain must use A or AAAA records. Additionally, a single DNS name cannot have both a CNAME record and other record types, preventing mixed configurations.

Best practices include using CNAME records only for subdomains and utilizing them for services that require indirection. Always document CNAME configurations for maintenance purposes, and be cautious of CNAME chains (multiple CNAME records pointing to each other), which can cause delays in DNS resolution.

Related Questions

What is the difference between A record and CNAME record?

A records point directly to an IP address, while CNAME records point to another domain name. A records can be used for root domains; CNAME records cannot. CNAME provides indirection and flexibility for managing multiple domains.

Can I use a CNAME for my root domain?

No, you cannot create a CNAME record for your root domain (example.com). You must use an A or AAAA record for the root. CNAME records are only allowed for subdomains.

How long do CNAME records take to propagate?

CNAME record propagation typically takes 24-48 hours globally as DNS changes spread across internet name servers. Some providers and locations may update faster within a few hours.

Sources

  1. Wikipedia - CNAME Record CC-BY-SA-4.0
  2. RFC 1035 - Domain Names - Implementation and Specification Public Domain