How to verify that Azure Reverse DNS is working properly?

雨燕双飞 提交于 2019-12-13 04:25:44

问题


I just got a static IP and ran the command below to get a reserved DNS:

Set-AzureService -ServiceName "people-dns" -Description "people-dns reverse DNS" -ReverseDnsFqdn "people-dns.cloudapp.net."

Now if I run Get-AzureService it shows:

ReverseDnsFqdn : people-dns.cloudapp.net.

How can I verify that it is working properly?

(it would be nice to automate this test so I can know if it stops working too)

UPDATE : I found web sites that can check like http://mxtoolbox.com but I like to know how they do it


回答1:


On Windows you can use ping or nslookup in command line. w.x.y.z is ip of your service.

For ping:

ping -a w.x.y.z

For nslookup:

nslookup
set type=PTR
w.x.y.z

For automation use powershell with this command:

[System.Net.Dns]::GetHostEntry("w.x.y.z")



回答2:


Probably the most reliable way of automating this would be to write a script to run on a schedule in Azure Automation that first queries Get-AzureService for the IP Address, and then checks the reverse PTR (using the command from @Łukasz Kałużny)

[System.Net.Dns]::GetHostEntry("w.x.y.z")

If these don't match you can configure it to email or pull a webhook etc to inform you.



来源:https://stackoverflow.com/questions/34561460/how-to-verify-that-azure-reverse-dns-is-working-properly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!