automation of nslookup

At the end of every month, I have to do reporting which involves manually doing nslookup of
IP addresses against whois (whois.domaintools.com, whois.net etc) of about 60 IP addresses.

Give the list of IP addresses in a text csv file in Windows, will need an automated way to look up
each of the IP, do a "whois" against one of those websites & populate into say a csv file for each
of the IP the owner of the IP.

need to do this in Windows if possible as I rarely have access to a Linux which has Internet
access.  So the output will be something like:

120.141.254.215, Kuala Lumpur Packet 1 Networks
119.90.130.109, AS23724 ChinaNet
sunhuxAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Dirk MareSystems Engineer (Acting IT Manager)Commented:
Look at the following article i used it not to long ago for a similar project.

After creating the file set it to run as a task (monthly)

Dirkmare
0
Bill PrewCommented:
Can you be more specific about the exact steps you use today, and what info you are getting from NSLOOKUP, and WHOIS?

There are a lot of existing free utilities that do things like this, and typically more, but they might be overkill for you.

Also, for windows BAT scripting, you could consider a tool that does the WHOIS work, like:

http://www.nirsoft.net/utils/whoiscl.html
https://technet.microsoft.com/en-in/sysinternals/bb897435%28en-us%29.aspx

~bp
0
sunhuxAuthor Commented:
>be more specific about the exact steps you use today
I copy IP address one by one from a csv file & paste them one at a
time into whois.domaintools.com, enter a 3-4 digit number to prove
I'm not a robot & then Submit to get who owns the IP address


So from nirsoft link given above, which of the following is the tool closest to my need?
WhoisThisDomain
IPNetInfo
WhosIP
WHOIS Servers List
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

sunhuxAuthor Commented:
Dirk's solution looks good but I haven't tested it yet
0
Bill PrewCommented:
Can you provide a test list of IPs for testing, want to make sure my approach handles the various IPs you are searching.

~bp
0
Bill PrewCommented:
If you want to try a test, get the WHOSIP utility from NIRSOFT, and then try this small BAT script that will read the ip list you specify near the top of the BAT, and loop through each line sending that IP to WHOSIP, and getting the Owner Name from the results.

@echo off
setlocal

set IpList=ips.txt

for /f "usebackq tokens=1" %%A in ("%IpList%") do (
  for /f "tokens=2 delims=:" %%B in ('whosip %%~A ^| find /i "Owner Name:" ^| more') do (
    for /f "tokens=*" %%C in ("%%~B") do (
      echo %%A="%%~C"
    )
  )
)

Open in new window

~bp
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Scripting Languages

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.