Skip to content

Instantly share code, notes, and snippets.

@davops
Created August 8, 2016 19:00
Show Gist options
  • Save davops/080b8e1e7a6674aa3f96fde42d217a0f to your computer and use it in GitHub Desktop.
Save davops/080b8e1e7a6674aa3f96fde42d217a0f to your computer and use it in GitHub Desktop.
Converts a server's DNS name to an IP address using the IPv4 address.
$dnsServer = "Server1.domain.com"
([System.Net.Dns]::GetHostAddresses($dnsServer) | where {$_.AddressFamily -eq 'InterNetwork'}).IPaddressToString
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment