PowerShell resolveHostByName
PowerShell’s Resolve-DnsName generate awful results. So old method for get IP address of machine for which we know only name is useful (BTW it’s strange how many support teams require provide only IP / port, not understanding application which are under, and even not able to resolve name using any kind of looking glass).
PS C:\h\z> [NET.DNS]::Resolve("www.google.com").AddressList.IPAddressToString -join ', '
108.177.127.99, 108.177.127.106, 108.177.127.105, 108.177.127.103, 108.177.127.104, 108.177.127.147
References
- https://stackoverflow.com/questions/15700421/check-for-dns-record-using-powershell-2-0
- Dns.GetHostByName Method (String)
- Technet Social: DNS Script - Powershell)
- Powershell script to convert IP to hostname and vice versa
- https://www.fortypoundhead.com/showcontent.asp?artid=24022
Written on July 14, 2018