Is the anyway to run nslookup (Centos 5 or windows) such that it will look up record types other than A, without having to go to interactive mode and using "set type="? For example, I'd like a command like the following:

nslookup --type=SRV _ldap._tcp.mydomain.com

link|improve this question

feedback

2 Answers

You actually almost had it. On both window (at least my Win7 box I have here) and Ubuntu you would do nslookup -type=SRV _ldap._tcp.mydomain.com (notice the single dash)

link|improve this answer
Damnit, beat me to it by 10 seconds – Mark Henderson Jan 5 '10 at 6:37
1  
nslookup -q=MX serverfault.com also works (except, replace MX with SRV and whatnot) – Mark Henderson Jan 5 '10 at 6:37
feedback

It appears the nslookup man page isn't correct anymore.

nslookup doesn't have a powerful non-interactive mode:

      "Non-interactive mode is used to print just the name and
       requested information for a host or domain"

Instead, use host(1):

host -t SRV example.com
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.