How can I find out which server hosts LDAP on my windows domain?

后端 未结 3 1800
后悔当初
后悔当初 2020-12-22 21:18

I am trying develop an application (C#) to query an LDAP server. I don\'t know the actual server named to query - is there a way to find out using standard windows tools or

3条回答
  •  不知归路
    2020-12-22 22:00

    AD registers Service Location (SRV) resource records in its DNS server which you can query to get the port and the hostname of the responsible LDAP server in your domain.

    Just try this on the command-line:

    C:\> nslookup 
    > set types=all
    > _ldap._tcp.<>
    _ldap._tcp.<>  SRV service location:
          priority       = 0
          weight         = 100
          port           = 389
          svr hostname   = <>.<>
    

    (provided that your nameserver is the AD nameserver which should be the case for the AD to function properly)

    Please see Active Directory SRV Records and Windows 2000 DNS white paper for more information.

提交回复
热议问题