Skip to main content
MediumDNSOWASP A05:2021CWE-1188

How to fix: CNAME record published at the zone apex

The registrable domain answers a CNAME query, but the zone apex always carries SOA and NS records. RFC 1034 forbids a CNAME from coexisting with any other record type at the same name.

Why it matters

Resolvers handle this inconsistently. Some follow the CNAME and never see the zone's MX record, which silently breaks inbound mail for the whole domain; others return the SOA and NS and ignore the CNAME, so the site does not resolve at all. Because the outcome depends on the resolver, the failure is intermittent and looks different to different users, which makes it very hard to diagnose from the server side.

This is exactly what ALIAS, ANAME and CNAME-flattening record types exist to solve: the provider resolves the target itself and answers with A and AAAA records at the apex, so what goes on the wire stays legal. A literal CNAME at the apex therefore means either the provider offers no such type, or the record was created through an API path that skipped the validation the web console would have applied.

How to fix it

  1. 1Replace the apex CNAME with the provider's ALIAS, ANAME, or CNAME-flattening record type.
  2. 2If the provider has no such type, publish A and AAAA records at the apex and keep the CNAME on www.
  3. 3Check inbound mail specifically: a broken MX lookup is the failure most likely to have gone unnoticed.

Code examples

Confirm the conflict

bash
dig example.com CNAME +short
dig example.com MX +short
dig example.com SOA +short

Correct apex configuration

DNS
; instead of: example.com. IN CNAME target.provider.net.
example.com.     IN A     203.0.113.10
example.com.     IN AAAA  2001:db8::10
www.example.com. IN CNAME target.provider.net.

References

Detected automatically by VulnRadar. The check id is dns-cname-at-apex, stable across every scan so you can filter or diff on it.

See every dns check

Questions

How severe is CNAME record published at the zone apex?
VulnRadar rates this medium severity in the dns category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
Does VulnRadar check for this automatically?
Yes. It runs as part of every scan under the check id dns-cname-at-apex, which stays the same between runs so you can filter, diff, or gate CI on it.
Which standards does CNAME record published at the zone apex map to?
It maps to CWE-1188. In the OWASP Top 10 it falls under A05:2021.

Missing a check?

The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.

Propose a checkHow a check is built

Scan your own site for cname record published at the zone apex

VulnRadar runs this check and hundreds more against a URL in seconds. No agent to install, just paste a URL.

Or scan this site as a demoRead the docs

CNAME record published at the zone apex fix | VulnRadar