Share This Post

PowerShell

PowerShell One-liner: Getting IP Address from a Hostname and Vice Versa

PowerShell One-liner: Getting IP Address from a Hostname and Vice Versa

Want to know the IP address of a hostname/domain name?

Use the following PowerShell one-liner:

[System.Net.Dns]::GetHostAddresses(“www.myITforum.com“)

Alternatively, you can flip the process to get the hostname of an IP address:

[System.Net.Dns]::GetHostbyAddress(“34.231.212.246”)


Looking for an awesome, no-nonsense technical conference for IT Pros, Developers, and DevOps? IT/Dev Connections kicks off in Dallas, Texas in 2018!

IT/Dev Connections

Share This Post

Leave a Reply