issues with create PTR record on azure DNS

leen haidar 20 Reputation points
2024-07-08T06:38:08.17+00:00

I have an issue with creating a PTR record to map an Azure public IP to my public domain name, which is hosted on Namecheap. I followed the structure described in the following link and created a reverse DNS zone using the first three octets of the public IP address. I then created a PTR record, named with the last octet of the public IP, and mapped it to my Namecheap domain name. However, after 10 hours since the creation of the PTR record, I tried to check the PTR record resolve command, and the result was "Non-existent domain":

Microsoft Documentation.

2

3

I followed every step in the link above. Additionally, I have delegated my domain by defining the Azure DNS record shown in the created reverse DNS in Namecheap DNS by adding an NS record.

1

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
631 questions
0 comments No comments
{count} votes

Accepted answer
  1. GitaraniSharma-MSFT 49,386 Reputation points Microsoft Employee
    2024-07-08T08:35:50.32+00:00

    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.

    User's image

    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:

    1. 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:

    136978-image.png

    1. 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:

    137051-image.png

    1. 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.

    137061-image.png

    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.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful