Who’s IP is it ?who’s the hostname behind it >?
Powershell Script Function to Resolve Ip to Name
here’s a function you can use to view the hostname belongs to IP ,
you can use it by input 1 or multiple IP’s –
ResolveIPtoName -IP 8.8.8.8,8.8.4.4
1 2 3 4 5 6 7 8 9 10 11 12 |
###Resolve Any IP to HostName### function ResolveIPtoName($IP) { $ResolvingResults = "" $ResolvingResults = @() $IPList += @($IP) foreach ($IP in $IPList) { try {$ResolvingResults += [System.Net.Dns]::GetHostEntry($IP)} catch{Write-Host $IP could not be Resolved -BackgroundColor Black -ForegroundColor Red} } $ResolvingResults | Select AddressList, HostName } |
(Visited 2,303 times, 3 visits today)