Re: Utility/tool to resolve a list of names
- From: Herb Martin <news@xxxxxxxxxxxxxx>
- Date: Thu, 01 Jun 2006 19:27:48 -0500
Vicente Zamora wrote:
Does anyone know of a tool or utility that would take in a list of
hostnames and would resolve each one of them to a text file with the IP
addresses? A command line tool would be nice.
I have a list of 500 windows hosts that I need to know their ip
addresses, and typing nslookup, copying and pasting into a spreadsheet
was getting old.
I found a number of utilities that would take in a list of names and
give me all sorts of information about the host (PsInfo from
Sysinternals is one, Dameware is another), but it doesn't give you IP
address.
There are some others that would take in an IP range and resolve them
to hostnames and ping them, then you can export into CSV or text.
Thanks,
Vince
Free NMap is a good tool, especially if you don't know all of the names.
Perl can be used to trivially write a program in a few lines to do this
(if you can program at all, or have a programmer.)
As can just using the built-in tools like NSLookup or even Ping to get
the info.
For instance a rough approximation to your request would be:
for /f %a in (names.txt) do ping %a | findstr "Pinging" >>addresses.txt
For the above to work, you would need the names in "names.txt" (one per
line) and you would want to start with no "addresses.txt" file (or an
empty one.)
More advanced versions would strip off the extraneous words and characters but that is also trivial to do with a text editor and
search and replace.
WARNING: If you make a "batch file" out of the above snippet (rather
than using it directly on the command line manually) then you must
DOUBLE each %-sign in %a (i.e., %%a) -- It's an oddity of batch files
on DOS/Windows.
--
Herb
.
- Follow-Ups:
- Re: Utility/tool to resolve a list of names
- From: Vicente Zamora
- Re: Utility/tool to resolve a list of names
- References:
- Utility/tool to resolve a list of names
- From: Vicente Zamora
- Utility/tool to resolve a list of names
- Prev by Date: Utility/tool to resolve a list of names
- Next by Date: find out which server is auth. for a dns zone
- Previous by thread: Utility/tool to resolve a list of names
- Next by thread: Re: Utility/tool to resolve a list of names
- Index(es):
Relevant Pages
|