I have a VM with a static public IP and I need to configure the PTR with my DNS, how can I do it?

music adders 0 Reputation points
2023-05-02T10:20:23.51+00:00

I have a VM with a static public IP and I need to configure the PTR with my DNS, how can I do it?

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

2 answers

Sort by: Most helpful
  1. Sreeju Nair 12,666 Reputation points
    2023-05-02T10:52:52.7766667+00:00
    0 comments No comments

  2. KapilAnanth-MSFT 49,611 Reputation points Microsoft Employee Moderator
    2023-05-02T11:15:59.9533333+00:00

    @music adders

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    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.

    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.

    For example: Suppose the PublicIpAddress resource has the DNS name xyz.northus.cloudapp.azure.com and IP address 23.96.52.53. The ReverseFqdn for the PublicIpAddress can be specified as:

    • The DNS name for the PublicIpAddress, xyz.northus.cloudapp.azure.com
    • The DNS name for a different PublicIpAddress in the same subscription, such as xyz2.westus.cloudapp.azure.com
    • A vanity DNS name or a custom DNS name, such as xyz.contoso.com, so long as this name is first configured as a CNAME to xyz.northus.cloudapp.azure.com, or to a different PublicIpAddress in the same subscription.
    • A vanity DNS name or a custom DNS name, such as xyz.contoso.com, so long as this name is first configured as an A record to the IP address 23.96.52.53, or to the IP address of a different PublicIpAddress in the same subscription.

    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.

    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:

    From PortalUser's image

    2)Then, go to your DNS provider and add a CNAME record pointing to this to the FQDN.

    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 "<Name>" -ResourceGroupName "<RG Name>"
    $pip.DnsSettings.ReverseFqdn = "<FQDN>"
    Set-AzPublicIpAddress -PublicIpAddress $pip

    For more info, refer : https://learn.microsoft.com/en-us/answers/questions/564126/how-to-create-a-ptr-record

    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.

    0 comments No comments

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.