Find name of Active Directory domain controller

How can I find out the name/IP address of the AD domain controller on my network?


Solution 1:

On any computer, that has DNS configured to use AD's DNS server do:

  • Start -> Run -> nslookup

    set type=all
    _ldap._tcp.dc._msdcs.DOMAIN_NAME
    

Replace DOMAIN_NAME with the actual domain name e.g. example.com. Read more here.

Solution 2:

For a computer that is a member of a domain the Environment Variable LOGONSERVER contains the name of the DC that authenticated the current user. This is obviously not going to be all DC's in a multi-DC environment but if all you want is a quick way to find the name of a Domain Controller then from a command shell:

set l <enter>

Will return all Environment variables that start with "L" including the name of a DC.