Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 12-08-2009, 01:39 AM   #1
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...

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, 03:35 AM   #2
Registered: Feb 2008
Location: JHB South Africa
Distribution: Centos, Kubuntu, Cross LFS, OpenSolaris
Posts: 806

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 10:53 AM
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 07:38 AM
[bash] how to put nslookup result next to ip in file kriezo Programming 5 02-25-2008 01:48 AM
How to read HTML or TXT file and output the data? koolkicks311 Programming 1 04-21-2007 12:13 AM
How can read from file.txt C++ where can save this file(file.txt) to start reading sam_22 Programming 1 01-11-2007 06:11 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:59 AM.

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