Re: Utility/tool to resolve a list of names

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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
.



Relevant Pages

  • Re: Remote Desktop does not work with machine name.
    ... When you ping the machine by name, ... tracert to machine name is unsuccessfull and does not resolve correct ip. ... What is the exact command you use to launch Remote Desktop? ... What is the exact command you use to launch Remote Desktop? ...
    (microsoft.public.windowsxp.general)
  • Re: Remote Desktop does not work with machine name.
    ... I don't know what this barefruit.com service is but if ping cannot ... resolve to the correct IP address? ... What is the exact command you use to launch Remote Desktop? ...
    (microsoft.public.windowsxp.general)
  • proxy scripts cant resolve hostnames after ISP moved server
    ... the proxy scripts on our website can no longer resolve third-party ... The odd thing is that tools like ping, telnet, etc. *are* able to ... resolve hostnames on the command line, ...
    (comp.os.linux.misc)
  • Re: ping hostnames problem
    ... > I can ping now to hostnames inside my network. ... default if the host you gave doesn't resolve a valid name (don't add to ...
    (Debian-User)
  • Re: cannot call ftp on dos prompt
    ... What does path say in a command prompt. ... > I get the same message for any command line such as ping, ... >>> How can I resolve this error: ...
    (microsoft.public.win2000.cmdprompt.admin)