Script: nslookup few hosts at once


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script: nslookup few hosts at once
# 1  
Old 06-07-2011
Script: nslookup few hosts at once

Hi Expert,

Is there anyway for me to nslookup more than one host at one time, instead of doing it one by one.

Thank you.
# 2  
Old 06-07-2011
May be this might help you..
Code:
      host [server]  Look up information for host using the current default
                     server or using server if specified.  If host is an
                     Internet address and the query type is A or PTR, the
                     name of the host is returned.  If host is a name and
                     does not have a trailing period, one or more domains
                     are appended to the name (this behavior depends on the
                     state of the set options domain, srchlist, defname, and
                     search).  Answers from a name server's cache are
                     labeled ``non-authoritative.''

# 3  
Old 06-07-2011
Code:
for i in `cat host.txt`; do nslookup $i; done

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies

2. Shell Programming and Scripting

Nslookup on a variable inside script not working

I am new at scripting. I have a file that each line is the shortname for a server. ie - Server1 Server2 Server3 I want to read in that file, do a nslookup and print the FQDN to a file. I added an echo statement to make sure my variable was being read and changing. But the nslookup... (5 Replies)
Discussion started by: kellyhkc
5 Replies

3. Shell Programming and Scripting

awk script on a list of hosts

SERVICE NOTIFICATION: SOC;invoice-skysmart-01.net;monthly_process_check;CRITICAL;notify-by-email;CRITICAL: (0) instance(s) of (monthly-processor6) running on host (less than 1) SERVICE NOTIFICATION: SOC;invoice-02.skysmart.net;JAVA_PROCESS_CHECK;CRITICAL;notify-by-email;CRITICAL: (0) instance(s)... (6 Replies)
Discussion started by: SkySmart
6 Replies

4. AIX

aix tcp wrappers hosts.allow hosts.deny?

hi all just installed the netsec.options.tcpwrapper from expansion pack, which used to be a rpm, for my aix 6.1 test box. it is so unpredictable. i set up the hosts.deny as suggested for all and allow the sshd for specific ip addresses/hostnames. the tcpdchk says the hosts allowed and... (0 Replies)
Discussion started by: wf201626
0 Replies

5. Shell Programming and Scripting

script to reboot multiple hosts

Hi Expert, How to create a script to reboot multiple hosts in linux? Thank you. (5 Replies)
Discussion started by: regmaster
5 Replies

6. Shell Programming and Scripting

nslookup script but having syntax issues

Hi All i am creating a script to perform a nslookup on a specified host (so in otherwords it will be: zong(script name) 172.x.x.10(ip adress). i am scripting in tcsh. unfortunately i think i am doing something wrong as it keeps giving me syntax error. can someone help? @ num=1 set arg='ping... (2 Replies)
Discussion started by: brian112
2 Replies

7. UNIX for Dummies Questions & Answers

creating script to perform a nslookup on all servers

Hi All i am trying to create a script (in tcsh) to do a nslookup on all the hosts i have here... can anyone help me? Kind regards. Brian (7 Replies)
Discussion started by: brian112
7 Replies

8. Shell Programming and Scripting

script for df output from multiple hosts

I am trying get "df -k" output from multiple hosts along with their hostnames via ssh, my script is appending the "df -k" output from all the nodes to a single file but not getting the hostnames for those nodes, just wondering how to pass more than one command via ssh or may be someone could come... (6 Replies)
Discussion started by: barkath
6 Replies

9. UNIX for Dummies Questions & Answers

hosts.allow & hosts.deny

Hi! Im trying to use host.allow & host.deny to resrtic access to my sun machine, but it doesnt seem to work... I want to allow full access from certain IPīs (ssh,http,ftp,etc...) but deny all kind of conections from outsideworld, the way that im doing that is: hosts.allow ALL:127.0.0.1... (2 Replies)
Discussion started by: Sorrento
2 Replies

10. Shell Programming and Scripting

NSLOOKUP script

Hi Anyone know of a quick and simple way to script an NSLOOKUP's from a list/text file? Thanks, Gav (1 Reply)
Discussion started by: gavcollins
1 Replies
Login or Register to Ask a Question