how to find the GC in an w2k domain?

Anthony Liguori aliguor at
Thu Jun 12 15:32:53 GMT 2003

There's a MS-CLDAP query for it.  Essentially, one takes the list of 
domain controllers in the DNS SRV record _ldap._tcp.dc._msdcs.DOMAIN then 
sends out MS-CLDAP queries on the RootDSE for the Netlogon attribute with 
a filter (&(DnsDomain=DOMAIN)(Host=myHost)(NtVer=\0\0\0\6)).  Then one 
would look for an entry that has both ADS_CLOSET and ADS_GC set (and was 
in your domain).

We don't have an api yet to do this in Samba but in Windows one would use:

DsGetDcName(NULL, domain, NULL, NULL, DS_GC_SERVER_REQUIRED, &dc_info);

for details.

Anthony Liguori
Linux/Active Directory Interoperability
Linux Technology Center (LTC) - IBM Austin
E-mail: aliguor at
Phone: (512) 838-1208
Tie Line: 678-1208

Chere Zhou <qzhou at>
Sent by: at
11/06/2003 09:04 PM
Please respond to qzhou

        To:     samba-technical at
        Subject:        how to find the GC in an w2k domain?

I mean the Global Catelog server.  Is there a LDAP query for that?

More information about the samba-technical mailing list