Written in Delphi. Source included. No dependencies. Uses older Winsock functions but working fine on my Server 2012 HMS implementation. Untested on 2016.
Code: Select all
Set objDNSLookup = CreateObject("DNSScriptUtil.DNSLookup")
sHostname = "mail.hmailserver.com"
sIPAddress = objDNSLookup.GetIPByHostname(sHostName)
sRevHostname = objDNSLookup.GetHostnameByIP(sIPAddress)
wscript.echo sHostName & " --> " & sIPAddress & vbCRLF & sIPAddress & " --> " & sRevHostName