Learning Centre

What Is A Cname Record And When Should It Be Used?

Learn what a CNAME record is, when to use it for subdomains like www or staging, and how careful DNS configuration helps protect websites, SSL and email services.

On this page

    Definition

    CNAME Record

    A CNAME record is a DNS record that makes one hostname act as an alias for another hostname. Instead of pointing directly to an IP address, it points to another domain name that should be followed to find the final destination.

    CNAME records are most commonly used for subdomains, such as www, staging, shop, app or provider-specific verification hosts. They are useful, but they must be configured carefully because a wrong CNAME can break a website, affect SSL validation or interfere with other DNS records.

    Key Takeaways

    • A CNAME record points one hostname to another hostname, not directly to an IP address.
    • CNAME records are usually used for subdomains, third-party platforms, CDN services, staging sites and verification records.
    • A CNAME cannot normally be used at the root of a domain, and it should not share the same hostname with other DNS record types.

    Plain English Explanation

    What Does a CNAME Record Actually Do?

    A CNAME record tells DNS that one hostname is an alias of another hostname. When someone visits the alias, DNS follows the CNAME target and then looks up the final address from there. For example, the hostname www.example.com might be set as a CNAME pointing to example.com. When a browser asks where www.example.com should go, DNS sees that it should follow example.com, then resolves the final records attached to that target. This is different from an A record. An A record points a hostname to an IPv4 address, such as 203.0.113.10. A CNAME points to another hostname, such as hosting.provider.example. That distinction matters because CNAME records are often used where the destination may change over time. If a third-party platform changes its server IP addresses, you do not need to update your DNS if your CNAME points to the platform’s managed hostname. The provider can update its own records, and your alias continues to follow the target.
    CNAME records help connect subdomains and services without hard-coding an IP address.
    CNAME records help connect subdomains and services without hard-coding an IP address.

    Simple CNAME Record Example

    This is a simplified example of a CNAME record for a www hostname. The exact format varies between DNS providers, but the meaning is the same.

    dns
    Type: CNAME
    Name: www
    Value: example.com
    TTL: 3600

    In this example, www.example.com is an alias of example.com.

    How It Works

    How DNS Resolves a CNAME Record

    A CNAME lookup adds one extra step to the DNS process because DNS must follow the alias before finding the final destination.

    1. A visitor requests a hostname

      A browser, app or mail system asks DNS where a hostname should go, such as www.example.com.

    2. DNS finds the CNAME record

      The DNS response says that www.example.com is an alias of another hostname, such as example.com or a provider-managed hostname.

    3. DNS resolves the target hostname

      The resolver then looks up the target hostname’s final records, such as A or AAAA records, and returns the destination needed to complete the connection.

    Common Uses

    When Should a CNAME Record Be Used?

    A CNAME record should be used when a hostname needs to follow another hostname rather than point directly to a fixed IP address. This is common when the destination is controlled by another system, platform or provider. Typical uses include connecting www to a main website hostname, pointing a subdomain to a managed hosting service, connecting app or portal subdomains to a software platform, setting up staging environments and adding provider-supplied verification records. CNAME records are also used by some email platforms for DKIM selectors, Autodiscover and service verification. SPF and DMARC are usually TXT records, but broader email configuration may still involve CNAME entries depending on the provider. They are useful when flexibility matters. If the target system changes its infrastructure, the provider can update its own records without requiring every customer to change a direct IP address.
    CNAME records are often used to connect subdomains to managed website, email and platform services.
    CNAME records are often used to connect subdomains to managed website, email and platform services.

    CNAME Record vs A Record

    CNAME and A records both help direct internet traffic, but they do different jobs. Choosing the wrong one can make a service fail or create difficult troubleshooting issues.

    Feature CNAME Record A Record
    Points to Another hostname, such as hosting.provider.example An IPv4 address, such as 203.0.113.10
    Best used for Subdomains, provider-managed services and aliases that may change destination Root domains, fixed server destinations and direct hosting connections
    Main limitation Cannot usually be used at the domain root and cannot normally share a hostname with other records Needs updating if the server IP address changes

    Do Not Treat a CNAME as a Universal DNS Fix

    A CNAME record is useful, but it is not suitable for every DNS task. It should not normally be placed at the root of a domain, and it should not be added where other records already exist for the same hostname. Some DNS providers offer CNAME flattening, ALIAS or ANAME-style features, but these are provider-specific solutions and should be checked carefully before use.

    Common CNAME Record Mistakes

    Most CNAME problems come from using the record in the wrong place, copying provider instructions without checking the existing DNS zone, or assuming DNS only affects the website.

    Adding a CNAME where other records already exist

    Do this instead

    A hostname with a CNAME record should not normally have other record types attached to it. Check for existing A, TXT, MX or verification records before adding the CNAME.

    Using a CNAME at the root domain without checking provider support

    Do this instead

    Standard DNS does not allow a normal CNAME at the zone apex because the root must also hold records such as NS and SOA. Use the method recommended by your DNS provider, such as A records, flattening or an ALIAS-style record where supported.

    Creating long CNAME chains

    Do this instead

    Avoid pointing one CNAME to another CNAME if a more direct target is available. Chains can make troubleshooting harder and may add unnecessary lookup steps.

    Troubleshooting CNAME Problems

    If a website, subdomain or external platform stops working after a DNS change, the CNAME record is one of the first items to check.

    The subdomain does not load

    Likely cause

    The CNAME may point to the wrong target, the target hostname may not resolve, or DNS propagation may not have completed.

    Solution

    Confirm the exact target supplied by the provider, check for spelling errors and allow for propagation. If the service is business-critical, review the full DNS zone before making further changes.

    SSL or HTTPS errors appear

    Likely cause

    The CNAME may point to a service that does not have a valid SSL certificate for your hostname, or the provider may not have completed domain validation.

    Solution

    Check that the destination platform supports your custom hostname and that SSL validation records have been added correctly.

    Email authentication or verification fails

    Likely cause

    A CNAME may have been added to the wrong hostname, or it may conflict with an existing TXT, DKIM or verification record.

    Solution

    Compare the provider’s instructions against the current DNS zone. Do not remove existing email records unless you understand what service uses them.

    Business Impact

    How CNAME Records Affect Websites, Email, SSL and SEO

    A CNAME record can affect several parts of a business’s digital infrastructure. It is not only a website setting. For websites, a CNAME can direct a subdomain to a hosting platform, content delivery network, application or staging environment. If it points to the wrong target, visitors may see a failed page, a provider error or a certificate warning. For email, CNAME records may be used by providers for DKIM, Autodiscover or service verification. MX records should not point to a CNAME target, and incorrect DNS changes can affect sending, receiving or authentication. Email deliverability also depends on records such as SPF, DKIM and DMARC, so a DNS change should be reviewed in context. For SSL and TLS, a CNAME can be part of domain validation or hostname routing. The destination service still needs to support the hostname and issue a valid certificate. A CNAME alone does not secure a website. For SEO, a CNAME does not directly improve rankings. Its SEO impact is usually indirect. If DNS is wrong, a website may become unavailable, show HTTPS errors or create crawl problems. Search visibility depends on many factors, including technical SEO, site architecture, content quality, performance and reliability.
    DNS changes can affect more than a website, including email authentication, SSL and search engine access.
    DNS changes can affect more than a website, including email authentication, SSL and search engine access.

    CNAME Record Review Checklist

    Before adding or changing a CNAME record, review the surrounding DNS configuration. This helps reduce the risk of avoidable downtime during a launch, migration or platform setup.

    • Confirm the exact hostname and target

      Check whether the provider wants the full hostname, such as www.example.com, or only the host label, such as www. Also confirm whether the target needs a trailing dot in your DNS provider’s interface.

    • Check for existing records on the same hostname

      Look for A, AAAA, TXT, MX or other records that may conflict with the CNAME. Do not overwrite existing records unless you know what they do.

    • Plan for propagation and testing

      DNS changes may take time to update across networks. Test the website, SSL, email authentication and connected platforms after the change, especially during migrations.

    Professional Context

    Can You Add a CNAME Record Yourself?

    Yes, a business owner or internal staff member can often add a CNAME record if the DNS zone is simple and the provider instructions are clear. Many DNS interfaces make the process look straightforward. The risk is not the act of typing the record. The risk is changing DNS without understanding what the existing records support. A single hostname may be connected to a website, email platform, SSL verification, analytics tool, CRM, booking system or external application. Professional help is worth considering when the domain supports business-critical email, when several providers are involved, when you are launching or migrating a website, or when the current DNS records are undocumented. It is also useful when a previous provider, staff member or agency set up the domain and no one is sure what each record does. In those situations, the safer approach is to review the full DNS zone, document existing records, plan the change and test the affected services after the update.
    A DNS change is simple in form, but it can affect several connected business systems.
    A DNS change is simple in form, but it can affect several connected business systems.

    Our Approach

    How We Approach CNAME Records and DNS Management

    We treat DNS as part of a business’s digital foundation, not as an isolated technical setting. A CNAME record may look small, but it can affect a website launch, hosting migration, email setup, SSL validation or third-party platform connection. As part of domain management, hosting, website development or email work, we review DNS records in context. That means checking how the domain connects to the website, email platform, SSL, Cloudflare, verification tools and other systems before making changes. We use Cloudflare for DNS infrastructure, DDoS protection and SSL/TLS management where appropriate. We also coordinate DNS changes during migrations to reduce propagation delays and disruption, while recognising that propagation, registrar systems and other third-party providers can still cause temporary interruptions. Where email is involved, we consider DNS authentication alongside the website configuration. We primarily use Microsoft 365 for business email hosting, although other reputable third-party providers may be used depending on client requirements. Correct DNS configuration can improve deliverability, but no provider can guarantee inbox placement or uninterrupted third-party email availability.
    CNAME records should be managed as part of the wider domain, hosting and email environment.
    CNAME records should be managed as part of the wider domain, hosting and email environment.

    Useful DNS Terms

    These terms often appear when setting up or troubleshooting a CNAME record.

    Hostname
    The specific name being looked up in DNS, such as www.example.com or app.example.com.
    TTL
    Time to live. This controls how long DNS resolvers may cache a record before checking for an updated value.
    Zone Apex
    The root of a DNS zone, such as example.com. Standard DNS does not normally allow a typical CNAME record at this level.

    CNAME Record FAQs

    These quick answers cover common questions about CNAME records, DNS setup and practical usage.

    Can a CNAME point to an IP address?

    No. A CNAME record must point to another hostname. If you need to point directly to an IPv4 address, use an A record. For IPv6, use an AAAA record.

    Can I use a CNAME for my root domain?

    Not with a standard CNAME record. The root domain must also hold required DNS records such as NS and SOA. Some providers offer CNAME flattening, ALIAS or ANAME-style records, but these depend on the DNS provider.

    Does a CNAME record affect SEO?

    A CNAME does not directly improve rankings. However, incorrect DNS can make a site unavailable, cause SSL errors or create crawl problems, which can affect search visibility and user experience.

    Need Help Reviewing Your DNS Records?

    If you are preparing for a website launch, hosting migration, email setup or domain review, we can help assess your DNS configuration and plan changes carefully. Start with a practical review before changing records that support your website, email and connected platforms.

    Request a Domain Review Learn About Managed Hosting

    Keep learning

    Tap to call
    Enquire now

    Ask Dobble

    Ask a question

    Send us your question and the Dobble team will get back to you.

    Prefer to talk to us directly?

    Get in touch

    Contact us

    Tell us about your project and the Dobble team will be in touch shortly.

    Prefer to talk to us directly?