Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Is there a tool anywhere that can perform an nslookup and resolve an IP to a domain name using a list of IP Addresses?

Posted on 2004-10-28
8
Medium Priority
?
884 Views
Last Modified: 2008-03-04
I have a list of IP addresses (websites users are surfing too). We want to know the domains that these IPs resolve too, however, performing an nslookup or whois on each and every single IP would be insane!

Is there a tool anywhere that can perform an nslookup and resolve an IP to a domain name using a list of IP Addresses?

Thanks
0
Comment
Question by:stzin
[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
  • 2
  • 2
8 Comments
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 2000 total points
ID: 12438781
Just script it.  Assuming it's a pure list of IPs, like:

192.168.1.55
10.44.55.12
192.168.77.41

Then the script/command (under NT-XP) would look something like this:

for /f "tokens=1" %a in (ipaddresses.log) do @ nslookup %a >> lookups.log

0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 12438810
(If you made that a command in a script, then you'd need to add a % to the %a's - they would look like %%a)

You can then further parse the lookups.log file by using FIND and dumping that output to a file.  What information do you want?  just the domain name/system name?  If so then you would do something like this in a file.cmd:

for /f "tokens=1" %a in (ipaddresses.log) do @nslookup %a >> lookups.log
find /i "Name:" lookups.log > names.log

0
 
LVL 6

Expert Comment

by:joopv
ID: 12439899
nmap can do this.

http://www.insecure.org/nmap/
0
Looking for the Wi-Fi vendor that's right for you?

We know how difficult it can be to evaluate Wi-Fi vendors, so we created this helpful Wi-Fi Buyer's Guide to help you find the Wi-Fi vendor that's right for your business! Download the guide and get started on our checklist today!

 
LVL 1

Author Comment

by:stzin
ID: 12443835
leew where you wrtite "Name:" what should I actually be putting in there?
0
 
LVL 1

Author Comment

by:stzin
ID: 12443963
When I run the for script I keep getting "a was unexpected at this time".

I've tried different itterations of the script, like,
for /F "tokens=1" %a IN (ips.txt) DO nslookup %a

where ips.txt is a list with only 4 ips that looks like this:

100.100.100.100
101.101.10.1.101
102.1.1.1
103.1.1.1


Im trying to keep it as simple as possible just so I cant get some sort of output..what am I doing wrong?

0
 
LVL 6

Expert Comment

by:joopv
ID: 12444468
Did you try nmap yet?  It does exactly what you need.
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 12445540
If you run FOR /F... as a command, then you use %a.  If you run FOR /F as  a command in a batch file, then it must be referred to as %%a.  I screwed that up, my apologies.
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 12445673
Where I write "Name:" you should be putting "Name:" - I didn't mean for this to be interpreted as a variable.  

What's going on is that when you run NSLOOKUP WWW.GOOGLE.COM, the output looks something like this:
Server:  myserver.mydomain.com
Address:  192.168.0.1

Non-authoritative answer:
Name:    www.google.akadns.net
Addresses:  64.233.161.99, 64.233.161.104
Aliases:  www.google.com

So I'm using Find "Name:" - which is in the 5th line of the output and contains the looked up domain.  Find would display that line, but I'm redirecting output from it to a file instead.  If you wanted to get rid of the Name: part of each line in the output file, then you could run this added line in the script (remember %a or %aa depending on whether it's a batch file or just run as a single command on the command line:

FOR /f "tokens=2" %a in (names.log) DO Echo %a >> namesonly.txt
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
This article is a collection of issues that people face from time to time and possible solutions to those issues. I hope you enjoy reading it.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
Suggested Courses

597 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