Hey Padma, fomr whatI understand, You have a list of IPs (100) and you'd like to run an nslookup on all of them without having to repeat the steps everytime. So I thought maybe you could do it with a batch script. I know you wanna learn Perl, but maybe you can do that later as well. Here's the Batch script (I will not take credit for this code, originally not from me):
[pre]
@echo off
if exist list.txt del list.txt
:: list of name servers
for %%i in (69.54.120.1xx
69.54.120.2xx ) do (
:: list of sites
for %%j in (192.168.xxx.1xx
192.168.xxx.2xx
192.168.xxx.3xx
192.168.xxx.4xx ) do (
for /f "tokens=1*" %%k in ('nslookup %%j %%i') do (
if [%%k]==[Server:] set server=%%l
if [%%k]==[Address:] set address=%%l
if [%%k]==[Addresses:] set address=%%l
if [%%k]==[Name:] set name=%%l)
call echo %date% , %%server%% , %%name%% , %%address%%>>list.txt
)
)
[/pre]
[u]Explanation:[/u]
list.txt is the name of file that the result will get saved to. This file usually gets saved under the user-account name (c:\documents and settings\%username%\)
the address : 69.54.120.1xx and 2xx are the two DNS servers
The addresses: 192.168.20.1xx, 2xx .. are the IP's that you want to get resolved.
To use, save everything startingfrom "@ECHO" till the two "))" into a filename.bat and just execute.
Hope this helps.
Ash
edit:making it pretty