Finding the Closest Domain Controller
Monday, January 5th, 2009Using a command-line interface
The following command finds the closest domain controller in the specified domain (<DomainDNSName>); that is, a domain controller that is located in the same site or in the closest site if a local DC is not available. By default, it will return the closest DC for the computer nltest is being run from, but you can optionally use the /server option to target a remote host. If you are interested in finding a DC within a particular site regardless of whether it is the closest DC to you, you can also optionally specify the /site option to find a domain controller that belongs to a particular site.
> nltest /dsgetdc:<DomainDNSName> [/site:<SiteName>] [/server:<ClientName>]