Skip to content

Instantly share code, notes, and snippets.

@m4vr0x
Created May 23, 2018 05:54
Show Gist options
  • Save m4vr0x/ebff17896c6a0fd2f9e0dca231ef1af1 to your computer and use it in GitHub Desktop.
Save m4vr0x/ebff17896c6a0fd2f9e0dca231ef1af1 to your computer and use it in GitHub Desktop.
Basic nslookup loop script for Windows
//nslookup - subnet range
c:\>for /L %i in (1,1,255) do @nslookup 10.10.10.%i [server to resolve from] 2>nul | find "Name" && echo 10.10.10.%i && @echo [ctrl+g]
//nslookup - file of ip's
NAME c:\>for /F %i in ([file.txt]) do @nslookup %i [server to resolve from] 2>nul | find "Name" && echo %i
ADDRESS c:\>for /F %i in ([file.txt]) do @nslookup %i [server to resolve from] 2>nul | find "Address" && echo %i
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment