Root or apex domains, such as example.com, require special DNS handling because they cannot use standard CNAME records in the same way as subdomains. DNS flattening, ALIAS records, ANAME records, Azure DNS alias records, or equivalent DNS provider features can be used to support apex-domain resolution.
This article explains root domain DNS configuration, the limitations of standard DNS records, and how DNS flattening can be used to support root domain scenarios in accordance with Microsoft guidance. It also covers a separate concern: confirming that requests cannot bypass the intended edge layer by reaching the origin service directly from the public internet. DNS flattening controls how the domain resolves, but it does not protect the origin from direct access.
Review the DNS and origin access configuration if one or more of the following apply:
Apex or root domains have DNS limitations that do not apply to subdomains. A CNAME record can be created for a subdomain such as www.example.com, but DNS standards prevent assigning a CNAME directly at the zone apex, such as example.com.
There might be misunderstanding about the following concepts:
DNS flattening, ALIAS records, or ANAME records can be used by some DNS providers to point an apex domain to a hostname while remaining DNS-compliant.
Origin access validation confirms whether the backend origin can be reached directly outside the intended edge path. If the backend origin remains publicly reachable, requests might bypass the intended edge layer, such as Azure Front Door, CDN, WAF, or Application Gateway.
A domain can be correctly flattened and still expose its origin. Correcting the DNS record type does not automatically protect the origin service from direct internet access. Both concerns must be validated independently.
DNS flattening controls how the apex domain resolves. Origin protection controls whether the backend can be reached directly outside the intended edge path.
The risk of origin exposure varies depending on the architecture used. Common deployment patterns and considerations are shown below:
| Architecture | Exposure Considerations |
| Application Gateway → App Service | Validate that App Service is reachable only through the intended Application Gateway path. |
| Azure Front Door → App Service | Validate that the origin accepts only intended Azure Front Door traffic. |
| Azure Front Door → Application Gateway → App Service | Validate that both Application Gateway and App Service cannot be bypassed directly. |
| Third-party CDN/WAF → Application Gateway → App Service | Validate that ingress is limited to the provider's published IP ranges and the origin is not directly reachable. |
For the aforementioned scenarios, follow these steps.
For an apex or root domain, do not configure a static A record that points to an Azure Front Door endpoint IP address. Azure Front Door does not expose a stable frontend public IP address for this purpose, and Microsoft warns that the endpoint IP address might change.
Use one of the following supported approaches instead:
Microsoft documentation confirms that Azure Front Door supports apex domains but requires special DNS handling, such as Azure DNS alias records or CNAME flattening from a provider that supports it.
After DNS flattening or an equivalent apex-domain configuration is in place, validate origin exposure separately.
Confirm the following:
If Azure Front Door is the intended edge service, configure the origin so that it only accepts traffic that comes through Azure Front Door.
Recommended controls include:
Note: Available origin-protection options vary by Managed Cloud platform generation. PaaS 2.0 environments support Private Endpoint-based architectures, while PaaS 1.0 environments rely primarily on access restrictions and WAF controls.
Validate potential bypass points:
Note: Available origin-protection options vary by Managed Cloud platform generation. PaaS 2.0 environments support Private Endpoint-based architectures, while PaaS 1.0 environments rely primarily on access restrictions and WAF controls.
If Application Gateway is intentionally used as the public-facing edge, confirm that App Service does not expose a separate reachable public endpoint outside Application Gateway.
For App Service, use access restriction rules to control inbound access. Microsoft documentation states that App Service access restrictions define an allow/deny list that controls network access, and when entries exist, an implicit deny-all exists at the end of the list.
If a third-party edge provider is used, confirm that:
Use the following validation checklist after updating the DNS or origin access configuration:
Note:
For more information, see the following Microsoft documentation: