Apex domain

Also known as: root domain · naked domain

On this page 7

An apex domain is the registered domain name itself, such as example.com, written without any subdomain label in front of it; in DNS terms it is the name at the zone apex, the point where a zone’s SOA and NS records live. In the vocabulary of domain names on the Internet it is also called the root domain or naked domain, although the first synonym is easily confused with the DNS root.

The apex matters because it carries special technical constraints. It must hold the zone’s administrative records, which is why a CNAME is forbidden there, and it is the address that many users type first, so hosting, email and certificate decisions often begin at the apex.

What defines the apex of a domain

The apex is defined by where a DNS zone begins, not by how many labels a name has. For example.com, the apex is the second-level domain that the registrant obtained from a registrar. Under country codes with a registration layer, such as example.co.uk, the apex has three labels because co.uk is a public suffix.

Tools that need to find the apex automatically, such as browsers setting cookies or certificate authorities checking scope, rely on the Public Suffix List to decide where the registrable part of a name starts. The table below shows how the apex relates to other levels of a hostname.

LevelExampleWho controls it
DNS rootThe trailing dotRoot zone operators under IANA
Top-level domaincom, de, orgRegistry operator
Public suffixcom or co.ukRegistry, listed in the Public Suffix List
Apex domainexample.com or example.co.ukRegistrant through the registrar
Subdomainshop.example.comRegistrant through its DNS zone
Levels of a fully qualified hostname

Why a CNAME cannot exist at the apex

A CNAME cannot exist at the apex because the DNS standards require that a name holding a CNAME hold no other data, while every zone apex must hold SOA and NS records. RFC 1034 and later clarifications make these two rules incompatible, so a compliant authoritative server rejects an apex CNAME.

This becomes a practical problem when a site is hosted on a platform that provides only a hostname, such as a content delivery network or a load balancer whose IP addresses change. A subdomain can simply point a CNAME at that hostname, but the apex needs another mechanism to follow the target.

MethodHow it worksMain trade-off
Static A and AAAAApex holds fixed IPv4 and IPv6 addressesBreaks if the provider changes addresses
ALIAS or ANAMEDNS provider resolves the target and answers with addressesProprietary, not portable between providers
CNAME flatteningProvider follows the CNAME chain at query timeGeographic routing may be less precise
HTTPS or SVCB recordAliasMode record points the apex to a target nameClient support is still incomplete
Redirect to wwwApex A record reaches a server that issues an HTTP 301Requires a small redirect service
Ways to point an apex domain at a hosted service

The HTTPS and SVCB record types, standardized in RFC 9460, are the first standards-based answer to the apex aliasing problem, but A and AAAA records remain necessary as a fallback for clients that ignore them.

Apex domain versus the www subdomain

The apex and the www subdomain are separate names that can serve the same website, and operators must choose which one is the canonical address. Both must resolve, and one should redirect permanently to the other so that search engines index a single version.

AspectApex as canonicalSubdomain www as canonical
AppearanceShorter and cleaner in marketingConventional and instantly recognized
CDN integrationNeeds ALIAS, flattening or static addressesA plain CNAME works
Cookie scopeCookies set on the apex can reach all subdomainsCookies stay isolated to www
Operational flexibilityHarder to move between providersEasier traffic steering and failover
Apex and www as the canonical host

The cookie scope issue is often overlooked: when a site sets cookies for example.com with a domain attribute, browsers send them to every subdomain, including unrelated services, which adds bandwidth and potential security exposure.

Records commonly published at the apex

Beyond the mandatory SOA and NS records, the apex usually holds the records that describe the domain as a whole. Because email addresses and verification checks use the bare domain, these records must be placed at the apex rather than on a subdomain.

  • MX records that route mail for addresses such as info@example.com.
  • TXT records carrying SPF policies and ownership verification tokens.
  • CAA records that restrict which certificate authorities may issue certificates.
  • DS records at the parent, linking the apex to the DNSSEC chain of trust.
  • A, AAAA or HTTPS records that point web traffic for the bare name.

DMARC is the notable exception: its policy lives at _dmarc.example.com, a dedicated label below the apex, so that it does not crowd the apex TXT record set.

Common mistakes with apex domains

Most apex problems arise when operators configure only one of the two common hostnames or treat the apex like an ordinary subdomain. The table lists frequent errors and their corrections.

MistakeConsequenceCorrection
No record for the apexTyping the bare domain shows an errorAdd A, AAAA or ALIAS records with a redirect
Certificate covers only wwwBrowser warning on the bare domainInclude both names in the certificate
CNAME added at the apexZone rejected or mail delivery breaksUse ALIAS, flattening or static addresses
Missing AAAA recordIPv6-only clients cannot connectPublish IPv6 addresses for the apex
Apex configuration errors

Some DNS control panels once accepted an apex CNAME silently; the record then shadowed the MX records, and mail delivery failed even though the website worked. Testing mail and web separately after any apex change avoids this trap.

Understanding it simply

Think of a domain as a street address. The apex domain is the main building number, such as example.com, while subdomains such as shop.example.com are individual apartments inside that building.

The main address has duties the apartments do not have. It holds the official details about who manages the building and where mail goes, so it cannot simply forward everything elsewhere. That is why setting up a website on the bare domain sometimes needs a special arrangement with the DNS provider.

Applied in practice

A small online bookstore moves its website to a content delivery network that provides only a hostname, such as bookstore.cdn-provider.net. The www subdomain gets a simple CNAME to that hostname, but the apex bookstore.example cannot. The DNS provider offers CNAME flattening, so the administrator creates a flattened record at the apex that returns the network’s current IPv4 and IPv6 addresses.

The apex keeps its MX and SPF records for the shop’s mail, and the web server issues an HTTP 301 from www to the bare domain, which the owner prefers for branding. A certificate covering both names is installed. After the switch, both addresses load in under a second, mail keeps flowing, and search results consolidate on one canonical apex address.