Hello @leen haidar ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
I understand that you are facing issues creating PTR record on Azure DNS.
The documentation that you are following, explains how to host reverse DNS lookup zones in Azure DNS which means you can host reverse DNS lookup zones for your ISP-assigned IP blocks on Azure DNS. The IP ranges represented by the reverse lookup zones must be assigned to your organization, typically by your ISP.
But if your requirement is to configure reverse DNS (PTR records) for services hosted in Azure (compute resources such as virtual machines, virtual machine scale sets, and Service Fabric clusters having Public IP addresses), then you need to refer the below article:
https://learn.microsoft.com/en-us/azure/dns/dns-reverse-dns-for-azure-services
Services in Azure use IP addresses assigned by Azure and owned by Microsoft. These reverse DNS records (PTR records) must be created in the corresponding Microsoft-owned reverse DNS lookup zones.
Based on your IP address, it appears you are trying to create a PTR record for an Azure Public IP, which fits the second scenario. Please follow the steps below for your configuration.
As explained in this doc, Azure only allows the creation of a reverse DNS record where domain name specified in the reverse DNS record is the same as, or resolves to, the DNS name or IP address of a PublicIpAddress or Cloud Service in the same Azure subscription.
NOTE: You can configure reverse DNS for PublicIpAddress resources in the Resource Manager deployment model, using either Azure PowerShell, Azure classic CLI, or Azure CLI. Configuring reverse DNS for PublicIpAddress resources is not currently supported via the Azure portal.
To add reverse DNS to an existing PublicIpAddress, you need to make sure that the Public IP address has a DNS name.
Detailed steps:
I have a custom domain "msazurelabs.tk
" (in your case this is the domain you have in Namecheap) and wanted to use this domain to setup as a reverse DNS for my Azure VM's static Public IP, so below are the detailed steps that I followed in my own lab to configure a custom reverse DNS and you can refer the same:
- First add a DNS label for the Public IP address for which you want to create a PTR record. You can do this either via Azure portal or using the PowerShell commands:
- Once the DNS name of the Public IP address is configured and replicated, you will have to go to your DNS provider where your custom domain is (in your case Namecheap) and create an A record for the custom DNS to point to the Public IP address or a CNAME record pointing to the Public IP’s DNS name as below:
- Once the A record or CNAME record is configured & replicated, you can go ahead and set Reverse DNS as follows using the below Azure PowerShell commands:
$pip = Get-AzPublicIpAddress -Name "VM2PublicIP" -ResourceGroupName "Training-Lab"
$pip.DnsSettings.ReverseFqdn = "msazurelabs.tk"
Set-AzPublicIpAddress -PublicIpAddress $pip
It should execute successfully and give the following output:
Name : vm2publicip ResourceGroupName : Training-Lab Location : eastus
ProvisioningState : Succeeded Tags : PublicIpAllocationMethod : Static
IpAddress : 52.168.167.212 PublicIpAddressVersion : IPv4 IdleTimeoutInMinutes : 4
IpConfiguration : { "Id": "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxxx/resourceGroups/Training-Lab/providers/Microsoft.Network/networkInterfaces/vm2269/ipConfigurations/ipconfig1" }
DnsSettings : { "DomainNameLabel": "msazurelabs", "Fqdn": "msazurelabs.eastus.cloudapp.azure.com", "ReverseFqdn": "msazurelabs.tk" } Zones : {}
Sku : { "Name": "Basic", "Tier": "Regional" } IpTags : [] ExtendedLocation : null
NOTE: It may take some time to replicate the settings and then you can verify the same using Digwebinterface as below.
Kindly let us know if the above helps or you need further assistance on this issue.
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.