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

Written on July 14, 2018