Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question

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

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

This work for me

nslookup -q=SRV 

So nslookup -q=SRV

Server:  myhost.local  
Address: (my ip)

Non-authoritative answer:    SRV service location:  
          priority       = 100  
          weight         = 1  
          port           = 443  
          svr hostname   =  internet address =  AAAA IPv6 address = 1111:111:ffff:3004::35
share|improve this answer

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
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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