Skip to content

Instantly share code, notes, and snippets.

@motowilliams
Created January 28, 2016 05:31
Show Gist options
  • Save motowilliams/f8eea672dd304d8464a5 to your computer and use it in GitHub Desktop.
Save motowilliams/f8eea672dd304d8464a5 to your computer and use it in GitHub Desktop.
Looks up public IP address and gets the public host name
$ipaddress = Invoke-RestMethod -Uri "https://api.ipify.org"
$dnsName = Resolve-DnsName -Name $ipaddress
$nameHost = $dnsName.NameHost
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment