Nslookup Guru's Needed!

Associate
Joined
6 May 2011
Posts
470
Hey guys,

I need some help with an nslookup command. It will be ran as a single line (hopefully)

I need the equivalent of this, but as a single command:

nslookup
> server 127.0.0.1
> ls -d test.com.

The reason it needs to be a single line is, the program that runs it will only run 1 command, wait on the result being returned, then quit - so I cant run it as above ^

And ideas how I can do this? So far I have: nslookup test.com. 127.0.0.1 - I just don't know where to put the "ls -d" bit!

Thanks in advance!
 
you can usually use && to put 2 commands on the same line like this....

Code:
nslookup 127.0.0.1 && nslookup 192.168.1.1

but it seems you can't use "ls" on the command line. maybe it is possible with other commands? i'm not familiar with nslookup other than using it to check domains. :p
 
create a file called something like...

nslucmds.txt

in that file put the commands followed by exit...

server 127.0.0.1
ls -d test.com.
exit


and then....

type nslucmds.txt|nslookup

Not the nicest way to do things but if it is something you do a lot on a load of different lookups you could wrap it in some code to script it.
 
Back
Top Bottom