Share via

How to add a PTR record for mail delivery to my azure VM

Edhy Rijo 20 Reputation points
2026-02-02T02:23:09.24+00:00

I am hosting my mail server on an Azure VM and I need to configure reverse dns for my public IP, but this IP does not expose the ReverseFqdn property, and I cannot find a way to enable it so my email application works as expected.

Appreciate any insight to enable reverse DNS on my Azure IP resource.

Azure DNS
Azure DNS

An Azure service that enables hosting Domain Name System (DNS) domains in Azure.

0 comments No comments

Answer accepted by question author
  1. Deepanshu katara 18,145 Reputation points MVP Volunteer Moderator
    2026-02-02T06:23:58.5566667+00:00

    Hello, Welcome to MS Q&A

    Requirements

    • Static Public IP: Reverse DNS is only supported on static public IP addresses in Azure.
    • Matching Forward DNS: The hostname you configure must resolve back to the same public IP (via an A or CNAME record).
    • Azure CLI or PowerShell: The property cannot be set in the portal UI.

    So pls tyr use this PS Script to achieve this

    # Login to Azure
    Connect-AzAccount
    
    # Get your public IP resource
    $publicIP = Get-AzPublicIpAddress -Name "MyPublicIP" -ResourceGroupName "MyResourceGroup"
    
    # Set the ReverseFqdn property
    $publicIP.DnsSettings.ReverseFqdn = "mail.example.com."
    
    # Update the resource
    Set-AzPublicIpAddress -PublicIpAddress $publicIP
    
    
    

    Kindly check and let me know if any ques

    Thanks
    Deepanshu

    1 person found this answer helpful.
    0 comments No comments

Answer recommended by moderator
  1. Ravi Varma Mudduluru 9,285 Reputation points Microsoft External Staff Moderator
    2026-02-02T10:10:21.6733333+00:00

    Hello @Edhy Rijo,

    Thanks for reaching out to Microsoft Q&A.

    It looks like you need to set up reverse DNS (rDNS) for your mail server hosted on an Azure VM, specifically by adding a PTR record to your public IP. Here’s a quick guide on how to achieve that:

    Setting up a PTR record for Reverse DNS on Azure.

    1. Create a Reverse DNS Zone: Azure uses the in-addr.arpa domain name for IPv4 reverse DNS lookups. Ensure you have a DNS zone created for your public IP range.
    2. Add the PTR Record:
      • Go to the Azure portal and navigate to your DNS zone.
      • Click on Record sets and then select +Add.
      • For the Name field, enter the last octet of your IP address (for instance, if your IP is 192.0.2.15, you enter 15).
      • For Type, select PTR.
      • For Domain name, enter the fully qualified domain name (FQDN) of your mail server.
      • Click Add to create the record.
    3. Setting the ReverseFqdn Property (for Public IP): You might also need to set the ReverseFqdn property on your Public IP resource, especially if you are using Microsoft-owned domain zones. Here’s how to do that:
      • Use Azure PowerShell or Azure CLI to set the ReverseFqdn.
      • Here’s an example using Azure CLI:
             az network public-ip update --resource-group <yourResourceGroup> --name <yourPublicIpName> --reverse-fqdn <yourFqdn> 
        

    Reference documents:

    Create a DNS PTR record

    Configure Reverse DNS for SMTP service
    Host Reverse DNS lookup zones in Azure DNS

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Edhy Rijo 20 Reputation points
    2026-02-03T14:12:17.1366667+00:00

    Hi Deepanshu katara and Ravi Varma Mudduluru,

    Thank you both for taking the time to provide me with your answers. They both apply to my situation, and I was able to create the PTR record required by my mail server.

    0 comments No comments

Your answer

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