top of page

PowerShell - Resolve entire subnet IP to Hostnames

  • Writer: Jon Boyette
    Jon Boyette
  • Jan 25, 2022
  • 1 min read

Copy and paste in PowerShell window, Or save as a self named .ps1, enter subnet to discover as 10.10.10. making certain of the last period, Resolves ALL 255 range to names

$A = Read-Host "Enter Subnet to walk through 255 range (ex 10.10.202.) resolving live IP to hostname"


$net = "$A"


0..255 | foreach {$r=(Resolve-DNSname -ErrorAction SilentlyContinue $net$_ | ft NameHost -HideTableHeaders | Out-String).trim().replace("\s+","").replace("`r","").replace("`n"," "); Write-Output "$net$_ $r"} | tee c:\temp\ip_hostname.txt


 
 
 

Recent Posts

See All
PowerShell - List All Domain SPNs

Save as same List_ALL_SPNs.ps1 or similar, this LDap calls the Domain for all Service Principal names and accounts related #Build LDAP...

 
 
 
PowerShell - Start-Monitoring

This is a great script used to Monitor and Email if a server is up or down, once ran, and smtp and from address is set, then run:...

 
 
 

Comments


Post: Blog2 Post
  • Facebook
  • Twitter
  • LinkedIn

©2022 by Boyette Technical Services. Proudly created with Wix.com

bottom of page