How can I find the LDAP server in the DNS on Windows?

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 http://support.microsoft.com/kb/200525), would this be correct?


You need to use an = after -type:

nslookup -type=srv _ldap._tcp.DOMAINNAME

In cmd shell:

nslookup 
set types=all
_ldap._tcp

None of the above worked for me, I got every time an error like this (I've tried with all the combinations I can think of with the domain names):

*** Unknown can't find _ldap._tcp: Non-existent domain

So another google search pointed to this method:

nltest /dclist:yourdomain.com

And this results in the list of the different servers in my network. Hope this saves an additional 2 minutes for someone else.