Resolve DNS and IP addresses with PowerShell
In this case we’re going to use the method GetHostAddresses of the Dns class of the Sytem.Net namespace. For PowerShell 2.0 you can use following Windows PowerShell One Liners:
Name to IP Address (DNS Forward) 1 2 [System.Net.Dns]::GetHostAddresses('graef.io') [System.Net.Dns]::GetHostAddresses('graef.io').IPAddressToString IP Address to Name (DNS Reverse) 1 2 3 4 5 [System.Net.Dns]::GetHostbyAddress('85.13.135.42') HostName Aliases AddressList -------- ------- ----------- graef.io {} {85.13.135.42} As of PowerShell 4.0 you can use the Cmdlet Resolve-DnsName as well as for both Forward and Reverse: