Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

List of Server Names Query for IP

Posted on 2009-07-10
7
Medium Priority
?
330 Views
Last Modified: 2012-05-07
I have a list of approxiamately 300 servers names in an excel spreadsheet that I copied to a test file (one servername per line). I need to run a command or utility that will give me the IP of each server. NSlookup doesnt apear to have a file import function and many of the port scanners only take list of ip to resolve to name. Any ideas?

thanks
0
Comment
Question by:apatrol50
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 29

Expert Comment

by:Jan Springer
ID: 24823659
If *nix:

#!/bin/bash

touch <output filename>

cat <input filename> | while read line
 do
   set $line
   host $line >> <output filename>
 done
0
 

Author Comment

by:apatrol50
ID: 24823751
Hi Jesper thanks for the reply. I am not a scripter. How do I package the commands you listed? thanks
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 24823823
Do you have a linux/solaris/hpux/tru64 operating system?  I am not familiar with windows batch commands.

Your other option would be to upload the domain names, I'll run it and upload the results.
0
Are You Ready for GDPR?

With the GDPR deadline set for May 25, 2018, many organizations are ill-prepared due to uncertainty about the criteria for compliance. According to a recent WatchGuard survey, a staggering 37% of respondents don't even know if their organization needs to comply with GDPR. Do you?

 

Author Comment

by:apatrol50
ID: 24823903
No we are all windows and the servers are not public so youwouldnt be able to run the script for me... thanks for the help though
0
 
LVL 29

Expert Comment

by:Jan Springer
ID: 24824042
What about something along the lines of (for a batch file):

for /f "%a" in (filename.txt) do nslookup "%a"
0
 

Author Comment

by:apatrol50
ID: 24839717
Hey Jesper how would you make this statement into a batch? If i save it in a text file and change the exension to .bat and run in a cmd prompt i get an error at the "for" statement
0
 
LVL 29

Accepted Solution

by:
Jan Springer earned 500 total points
ID: 24840344
The filename is whatever.bat.  You run it by typing 'whatever'.

You need to have the input file in the same directory or specify the full path name to the file.

Modify 'MyFilename.txt' and 'Results.txt' to what you would like.

This should work according to all of the batch scripting that I've read:

@echo off
for /F %a in MyFilename.txt do nslookup %a >> Results.txt
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
I originally wrote this article to compare SARDU and YUMI, but have now added Easy2Boot, since that is the one I currently use and find the easiest to create and alter.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question