Reverse DNS for VM behind an Application Gateway

Admin - Thomas Morel 1 Reputation point
2021-10-28T19:13:00.027+00:00

I have a VM running a public website but the VM has a private internal IP and no public IP. I have an Application Gateway, with a public IP, that is the entry point for my domain being hosted on the private-IP VM.

When I send emails from my VM/s command line, I keep getting the following error:

554 Connection Denied - Reverse Lookup Failure

I reviewed the docs page that says that a reverse DNS PTR record cannot be added to an Application Gateway.

What is the workaround? Do I assign a public IP to my VM and add an MX record for that IP or how do I fix this?

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
593 questions
Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,129 questions
{count} votes

1 answer

Sort by: Most helpful
  1. suvasara-MSFT 10,001 Reputation points
    2021-11-08T06:49:08.197+00:00

    @Admin - Thomas Morel , Apologies for the delayed response. Yes, Reverse DNS is currently not supported for the Azure App Service and Application Gateway. You need to explicitly configure your VM PIP with 'ReverseFqdn' property to enable it.

    Note: Configuring reverse DNS for a Public IP address resource is currently not supported in the Azure portal.

       $pip = Get-AzPublicIpAddress -Name "PublicIp" -ResourceGroupName "MyResourceGroup"  
       $pip.DnsSettings = New-Object -TypeName "Microsoft.Azure.Commands.Network.Models.PSPublicIpAddressDnsSettings"  
       $pip.DnsSettings.DomainNameLabel = "contosoapp1"  
       $pip.DnsSettings.ReverseFqdn = "contosoapp1.westus.cloudapp.azure.com."  
       Set-AzPublicIpAddress -PublicIpAddress $pip  
    

    Ref: https://learn.microsoft.com/en-us/azure/dns/dns-reverse-dns-for-azure-services

    0 comments No comments