Skip to content

Instantly share code, notes, and snippets.

@ctigeek
Created April 11, 2017 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ctigeek/d8e771b518b120b905f75e8b543a655a to your computer and use it in GitHub Desktop.
Save ctigeek/d8e771b518b120b905f75e8b543a655a to your computer and use it in GitHub Desktop.
Load whois servers from @weppos's repo.
if (-not $hostMap) {
$whoisHostMapUrl = "https://raw.githubusercontent.com/weppos/whois/master/data/tld.json"
$raw = Invoke-RestMethod $whoisHostMapUrl
$hostMap = @{}
$raw.psobject.Properties | ?{ $_.Value.host } | Foreach { $hostMap[$_.Name] = $_.Value.host }
}
## $hostMap["com"] will return whois.verisign-grs.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment