Score:1

Replacing A record on apex domain to cname

sg flag

We have our current corporate website hosted on traditional servers that we point to with an ip address. Our website is available at example.com and www.example.com and both domains have A records pointing at the the server ip.

We are now starting to host our website in Azure and the environment is fronted by Azure Front door. So we don't have an ip address anymore, only the address examplecom-prod.z01.azurefd.net.

For the www.example.com I think it's fairly simple to remove the A record and add a cname record pointing to examplecom-prod.z01.azurefd.net.

For the apex domain example.com I'm not sure. Is it as easy there? Just remove the A record and add a cname?

cn flag
Bob
Does this answer your question? [Why can't a CNAME record be used at the apex (aka root) of a domain?](https://serverfault.com/questions/613829/why-cant-a-cname-record-be-used-at-the-apex-aka-root-of-a-domain)
sg flag
In that answer it says "The bulleted list makes it explicitly clear that a SOA, NS, and A records cannot be seen at a node where a CNAME also appears. When we combine this with section 6.1, it is impossible for a CNAME to exist at the apex as it would have to live alongside mandatory SOA and NS records.". But is it actually so that a cname cannot exist at the apex domain if we remove the a record?
cn flag
Bob
No, removing the `A` record at the apex of your domain won't create a spot for a `CNAME` record. According to the relevant RFC's you would also need to remove the mandatory `SOA` and `NS` records, as well as the typical `MX` records and doing that would leave your domain inoperable.
sg flag
This is the best document describing it so far: https://www.isc.org/blogs/cname-at-the-apex-of-a-zone/. One solution state is to add an ALIAS record to the apex domain but it also says that's a "non-standard DNS feature". Does that still hold true or is that now a viable solution?
cn flag
Bob
The `ALIAS` or `ANAME` record is non standard in the sense that it depends on the capabilities of the authoritative name servers for your domain. If your DNS provider supports those, then you can use them but AFAIK they are not universally supported.
us flag
You need to use a redirect server where the apex A record points to, and that would do a `301` redirect to `www.example.com`.
Score:0
cn flag

Given that AWS supports this using Route53 Aliases, then I would expect a competitor to do the same.

A quick search shows this page which talks about apex records. You may have to migrate your DNS management into Azure for your public records to achieve this though.

sg flag
I don't thing the Ops team want to change our dns provider (a big telco who has managed it for us for a long time) and move our apex domain dns to azure.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.