LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Using nslookup from data in a .txt file in BackTrack (https://www.linuxquestions.org/questions/linux-newbie-8/using-nslookup-from-data-in-a-txt-file-in-backtrack-774139/)

RexRogan 12-08-2009 12:39 AM

Using nslookup from data in a .txt file in BackTrack
 
Hey all;

Basically, I have a list of bare IP addresses inside of a text file, and I need to figure out how to run NS lookup on each one of the IP addresses inside of this text file. Is there an easy way to do this by putting it in the same script?

so basically...

192.168.1.1
192.168.1.2
192.168.1.3

all inside of ips.txt

i've seen various commands for windows, but none for linux, and ive googled out the wazoo as well as looked at the built in manual. can anyone help?

datopdog 12-08-2009 02:35 AM

Code:

for ip in $(cat ips.txt); do
nslookup $ip
done



All times are GMT -5. The time now is 08:16 PM.