Azure – Reverse DNS while using Azure Resource Manager

azurereverse-dns

I am very much aware that Reverse DNS is possible on Azure Cloud Services. That's not what I'm asking about. I need to know if it's possible when using Azure Resource Manager. I've looked around a lot online, and while I've found some (2+ year) old questions about it, I can't find any answers.

Thanks!

EDIT AFTER:

I may be getting close. I now have a Resource Group configured, and I've given it a Static IP. That IP is 40.78.157.234. However, when I do a reverse lookup on that IP, I only get this:

enter image description here

I found this article, which offers a sample of how a Public IP could look in JSON format:

enter image description here

Mine looks very much like that. But I still can't do the Reverse Lookup.

Best Answer

In order to register a reverse DNS entry for a Web App, you need to have a forward DNS entry pointing to an IP Address within the same subscription.

This is simply to prove that you have some authority over the domain.

If you need to create the reverse DNS entry at the same time as creating the Web App, then you will need to register a temporary IP Address in Azure for the Web App creation process to look up and verify your ownership of the domain.

In this case you would run something like this

 $ip = New-AzureRmPublicIpAddress -Name TestIP1 `
                -ResourceGroupName $ResourceGroupName `
                -Location $location -AllocationMethod Static 

Then to find the IP Address you have just registered run

$ip.address 

On the other hand, if you have already deployed your Web App, you can simply ping it, or run (changing example for the actual name of your app) (If the web app is already running, you don't need to register a temporary address)

(Resolve-DnsName example.azurewebsites.net).ip4address 

Either way, you should get something like -

12.34.56.78

You can then register this address as an A record in DNS.

You can then register the reverse look up in Azure. For a template you can use

    "properties": {
    "publicIPAllocationMethod": "Dynamic",
    "dnsSettings": {
        "domainNameLabel": "[variables('PublicDNS2')]",
        "ReverseFqdn": "[concat(parameters('vmName2'), '.', variables('domainname'))]"
    }

In Powershell you would use

set-AzureRMWebApp -ResourceGroupName $AppServiceResourceGroupName -Name $AppServiceWebAppName -HostNames $reverseName

At that point you should have a reverse DNS entry configured.

If this is a new deployment, you would want to point the DNS entry that you pointed to the temporary IP address to the Web App you have just deployed. So again if you run

(Resolve-DnsName example.azurewebsites.net).ip4address 

You can then register that IP Address in DNS and you will have a forward address working as well.

Finally, if you used one, delete the temporary address

Remove-AzureRmPublicIpAddress -Name TestIP1 `
         -ResourceGroupName $ResourceGroupName -Force