CNAME must be alone
RFC 1034 says a node with a CNAME should carry no other data, but the apex must also hold SOA and NS records.
Monitor
Protect
Manage
By role
Security
Renewals
Monitoring
When www.example.com loads but example.com does not, the apex (root) domain has no A or AAAA record, or the redirect from apex to www is missing. The two names are separate DNS entries, so each needs its own record. The reverse case is a missing www record.
| Symptom | Likely cause | Fix |
|---|---|---|
| www loads, apex gives DNS error | No A or AAAA record at the apex | Add an apex address record |
| Apex loads, www gives DNS error | No www record | Add a www A, AAAA or CNAME record |
| Both resolve, apex shows a different site or an error page | Server does not serve both hostnames | Add the apex as a server alias or redirect |
| Apex CNAME rejected or breaks email | CNAME at the zone apex | Use an address record, or ALIAS/flattening if your DNS host supports it |
example.com. 3600 IN A 203.0.113.10
www.example.com. 3600 IN CNAME example.com.
; or point www at a provider hostname
www.example.com. 3600 IN CNAME sites.hosting-provider.example.Verify with dig example.com A +short and dig www.example.com +short.
RFC 1034 says a node with a CNAME should carry no other data, but the apex must also hold SOA and NS records.
Other records at the apex, such as MX and TXT, would conflict with a CNAME there.
Some DNS hosts offer CNAME flattening or an ALIAS record that answers with the target's address instead. Cloudflare documents its flattening.
Flattening returns an address at the apex instead of a CNAME, per Cloudflare's documentation. Names and support vary by DNS host.
Make both names resolve, then redirect one to the other with an HTTP 301 so search engines and visitors see a single address. Check that the TLS certificate covers both names, or the redirect itself will show a certificate warning.
Run dig example.com A +short and dig www.example.com A +short. The one with no answer is missing a record.
Use the DNS host your nameservers point to, not necessarily your registrar.
The server or hosting dashboard must list the apex and www as accepted names.
Send one hostname to the other with a 301 so there is one canonical address.
Both names must be covered by the TLS certificate, or the redirect shows a warning.
This split is common on new sites because the two names are set up separately. Some hosts offer a built-in redirect from the apex to www that has to be switched on.
Check both the DNS record and the redirect setting, since either one missing gives the same symptom.
They are two separate DNS names. Setting up www does not create anything for the bare domain. Add an A or AAAA record at the apex, and make your web server answer for that hostname or redirect it to www.
Standard DNS does not allow it, because a CNAME must not coexist with other data and the apex always has SOA and NS records. Some DNS hosts provide an ALIAS or CNAME flattening feature that works around this.
A name with a CNAME must have no other records, per RFC 1034. Adding an MX, TXT or A record at the same name as a CNAME is invalid. Many DNS hosts reject it. Move the CNAME to a subdomain or remove the other records.
Either works. Pick one, serve it as the canonical address and 301 redirect the other. Consistency matters more than the choice, and both hostnames need valid DNS and a matching certificate.
Aepto monitors expiry, DNS, SSL and uptime for every domain you own and alerts you when something changes. Free for 3 domains.