All Active Directory servers in a forest publish the rootDomainNamingContext attribute in their RootDSE object. This attribute contains the DN of the GC naming context. It also corresponds to the DNS domain name where the GC registers itself.
- Use the ldapsearch utility to obtain the DNS domain name:
ldapsearch -x -b "" -s base -H ldap://dir_name rootDomainNamingContext
The meanings of -x, -b, “”, -s base, and -H:// are similar to those shown in Locating the Configuration Naming Context.
dir_name is the DNS name of a directory in the root domain.
The ldapsearch command produces output similar to:
# extended LDIF # # LDAPv3 # base <> with scope base # filter: (objectclass=*) # requesting: rootDomainNamingContext # # dn: rootDomainNamingContext: DC=ROOTDOMAIN,DC=COM # search result search: 2 result: 0 Success # numResponses: 2 # numEntries: 1
where the rootDomainNamingContext is DC=ROOTDOMAIN,DC=COM.
- You can derive the DNS domain name from the value of the rootDomainNamingContext by removing the DC=, resulting in the DNS domain name ROOTDOMAIN.COM.Since domain names are not case sensitive, you can use the name rootdomain.com, where required, for the remaining tasks in this procedure.