LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2009, 12:39 AM   #1
RexRogan
LQ Newbie
 
Registered: Dec 2009
Posts: 3

Rep: Reputation: 0
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?
 
Old 12-08-2009, 02:35 AM   #2
datopdog
Member
 
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

Rep: Reputation: 41
Code:
for ip in $(cat ips.txt); do
nslookup $ip
done
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
AWK/Perl for extracting data from txt file to numerous other files briana.paige Linux - Newbie 2 05-05-2009 09:53 AM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
[bash] how to put nslookup result next to ip in file kriezo Programming 5 02-25-2008 12:48 AM
How to read HTML or TXT file and output the data? koolkicks311 Programming 1 04-20-2007 11:13 PM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 05:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration