Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

For Linux, this command should return the DNS record for the LDAP server

host -t srv _ldap._tcp.DOMAINNAME

(found at Authenticating from Java (Linux) to Active Directory using LDAP WITHOUT servername)

How could I get the same on the Windows command line using nslookup?

I tried

nslookup -type srv _ldap._tcp.DOMAINNAME

(following, would this be correct?

share|improve this question
up vote 15 down vote accepted

You need to use an = after -type:

nslookup -type=srv _ldap._tcp.DOMAINNAME
share|improve this answer
still can't get – ilhnctn Mar 13 '13 at 7:09

In cmd shell:

set types=all
share|improve this answer
Or, in one line nslookup -type=all _ldap._tcp. Wanted so I could redirect output to a file. – dsz 1 hour ago

Windows cmd prompt uses "query" instead of "type" for some forsaken reason. Interactive nslookup still uses "set type=srv".

nslookup -query=srv _ldap._tcp.DOMAINNAME

EDIT: while "query" works it seems that I am 100% wrong. "type" works too.

share|improve this answer
Are you sure about that? nslookup -type=srv _ldap._tcp.DOMAINNAME works as expected on Windows. – jscott Sep 7 '14 at 4:29
I stand corrected. Comment updated, thanks. – Andy Sep 9 '14 at 9:14

How to verify Service Location (SRV) locator resource records for a domain controller after you install the Active Directory directory service.

Use Nslookup to verify the SRV records, follow these steps:

  1. Click Start, and then click Run.

  2. In the Open box, type cmd.

  3. Type nslookup, and then press ENTER.

  4. Type set type=all, and then press ENTER.

  5. Type _ldap._tcp.dc._msdcs.Domain_Name, where Domain_Name is the name of your domain, and then press ENTER.

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.