I am currently trying to create an nslookup.cmd which will run on a number of addresses that are read from a text file.  I want it to have and output file also which logs the successful/unsuccessful nslookups.  Any ideas?  I know this can be easily done with Ping and tracert but I have been having problems with nslookup.
Who is Participating?
Kim RyanIT ConsultantCommented:
nslookup is deprecated so will not be supported for ever. The recommended replacements are host and dig. A simple solution is :
create a text file, say  IPs_to_find.txt

Then from command line,

dig -f IPs_to_find.txt +short >> ip_log.txt

This will append the short form output of dig to a text file  for all the lookup results  of addresses in IPs_to_find.txt.  Use dig -h to see more options.
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.

All Courses

From novice to tech pro — start learning today.