Map subdomain in Azure DNS Zone to website hosted on Azure VM (Cpanel)

Patrick Orville 0 Reputation points
2024-11-26T09:25:18.47+00:00

I have a domain (xyz.org) on Azure DNS Zone that points to a website hosted on Azure App Service, and I created a subdomain (abc.xyz.org) but will like to point this subdomain to a website hosted on Azure Virtual Machine (Cpanel).

I already entered the subdomain as an A record with the IP address of the VM but no luck. This is an urgent situation. Any help please?

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
707 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
8,174 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 48,081 Reputation points Microsoft Employee
    2024-11-28T07:31:58.6133333+00:00

    @Patrick Orville , Thanks for the detailed explanation.

    I understand,

    • You have a domain, "contoso.com" which is properly delegated to Azure
    • Now, you want to create a child domain, called "subdomain.contoso.com" and delegate this not to Azure, but to a third party software called cPanel residing inside VM.
    • For this,
      • You created an A record in "contoso.com" with "subdomain" and pointed this to the VM's IP
      • Then you also created a NS Record for "subdomain" in the DNS Zone "contoso.com"" with 4 name servers.

    Correct me if I am wrong.

    First of all, Are you sure these steps are valid?

    • Where did the 4 name servers for "subdomain" record came from?
      • Is it the name servers of "contoso.com"?
    • This is how a child Zone delegation works in Azure : Create a child DNS zone
      • Note that the Child Zone has a different set of name servers than the parent
      • The same concept goes for any DNS Host, so, in your case, the third party should provide you the name servers to host "subdomain.contoso.com"
      • You should not use the Parent Domain's name servers.
    • Additionally, See : Is a subdomain with both A records and NS records valid?

    If you want to delegate/host the ChildZone with a different vendor,

    • In the parent Zone, "contoso.com", add an NS record of name "subdomain" pointing to the name servers provided by them.
    • And use an Apex record or "@" to resolve "subdomain.contoso.com" to any IP you want

    Hope this clarifies.

    Thanks,

    Kapil


    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.