Skip to content
WebsiteHosting.com

concept Domains & DNS

CNAME record

See how a DNS CNAME aliases a hostname to another name and why ordinary records cannot share that alias owner.

Sources checked · P0017

What it means

A CNAME (canonical name) record says that one DNS name is an alias for another DNS name. It does not contain an IP address and does not redirect a browser to a different URL. When looking up an address through an alias, DNS resolution continues toward the target's relevant records. The web request still needs a server configured for the hostname the user visited. CNAME processing CNAME clarification

Try it

Example — follow one DNS alias. The domain and IPv4 address are reserved for examples; nothing is queried live.

www.example.com.   300 IN CNAME  site.example.net.
site.example.net.  300 IN A      192.0.2.45

For an address lookup of www.example.com, the answer can include the alias and then the address information for site.example.net. If the target is outside the original zone, additional lookups may be needed. Changing the CNAME target name is different from updating its target's A/AAAA addresses. An HTTP redirect, by contrast, is a web response and may change the visible URL. DNS aliases

Coexistence and the zone apex

At a standard CNAME owner name, the alias cannot coexist with ordinary resource records such as A, AAAA, MX or TXT. DNSSEC-related records have narrowly defined exceptions; that is not general permission to mix a CNAME with ordinary data. The apex of a zone needs SOA and NS records, so a standard CNAME at that same apex conflicts with those requirements. CNAME rule Zone records

Proposed setupStandard DNS result
www CNAME to a hostname, no other ordinary www RRNormal alias pattern
www CNAME plus www AConflict at the same name
Zone apex CNAME alongside required SOA/NSConflict at the same name
Provider ALIAS/ANAME or flattening featureProvider-specific behavior, not an ordinary CNAME

Some providers synthesize A/AAAA responses from a target name at the apex; read their provider documentation rather than assuming this is standard CNAME behavior. DNS also has standardized SVCB/HTTPS AliasMode for certain services, which is not equivalent to a generic CNAME and has different client support. Service binding AliasMode

In practice

Before editing an alias, record the exact owner name and target, check whether any ordinary records already exist at that owner, and use the hosting provider's documented configuration. Never replace a zone apex's NS/SOA or its MX/TXT mail data with an arbitrary CNAME. A CNAME doesn't itself provide a TLS certificate or move site contents.

Compare A and AAAA records for literal addresses. For a controlled cutover use Change a DNS record safely.

Sources & model boundaries

Primary references used for this explanation. The example above is illustrative; it is not a live check.

  1. RFC 1034 — Domain Names: Concepts and Facilities

    Sections 2.4, 3.1, 4.3.2 and 5. DNS tree, zones, referrals, resolvers and caching.

    Checked .

  2. RFC 2181 — Clarifications to the DNS Specification

    Sections 5 and 10. RRsets, CNAME coexistence, and MX/NS alias restrictions.

    Checked .

  3. RFC 1035 — Domain Names: Implementation and Specification

    Sections 3.2, 3.3 and 4. RR formats, TTL, A, NS, SOA, CNAME and MX records.

    Checked .

  4. RFC 9460 — Service Binding and Parameter Specification via DNS

    Section 2.4.2, AliasMode. Standard SVCB/HTTPS AliasMode differs from CNAME and vendor flattening.

    Checked .