When you update the public IP DNS label, it will create an "A record" that starts with the specified label (to the name you provide to create the fully qualified DNS name) and resolves to the public IP address, it will be registered with the Azure-provided DNS servers. Example: something.westus2.cloudapp.azure.com. You just can inject single label to that DNS suffix and can't add multiple labels like subdomain.
You need to have an custom domain to achieve this, Azure DNS isn't the domain registrar, Azure DNS currently doesn't support purchasing of domain names. If you want to purchase a domain name, you need to use a third-party domain name registrar. Azure DNS allows you to host a DNS zone and manage the DNS records for a domain in Azure. In order for DNS queries for a domain to reach Azure DNS, the domain has to be delegated to Azure DNS from the parent domain.
EX: When you have custom domain
contoso.com as your custom domain, then create an A record for your subdomain "subdomain.contoso.com" and point it to the public IP
EX: When you have custom domain and manage the records in Azure DNS
- Purchase contoso.com from third party domain registrar
- Create contoso.com as DNS zone in Azure
- In order for DNS queries for contoso.com to reach Azure DNS, the contoso.com has to be delegated to Azure DNS.
DNS delegation: https://learn.microsoft.com/en-us/azure/dns/dns-domain-delegation - Create an Alias record for your domain and A record for your subdomain "subdomain.contoso.com" and point the public IP
Select your Azure DNS zone to open the zone.
Select Record set.
Leave the Name text box empty to represent the domain name apex. An example is contoso.com.
Leave the Type as an A record.
Select the Alias Record Set check box.
Select Choose Azure service, and select the Public IP. Create Record: https://learn.microsoft.com/en-us/azure/dns/dns-operations-recordsets-portal- As the zone is delegated and we have records now the domain and subdomain will be resolved publically
Hope this was helpful. Please let us know in case of any additional questions or concerns.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well