Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

share|improve this question

7 Answers 7

up vote 78 down vote accepted

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

Start -> Run -> nslookup    
set type=all

Replace DOMAIN_NAME with actual domain name i.e. Read more here.

share|improve this answer

An unmentioned, super easy, and quick option is to run this from a command prompt:

nltest /dclist:domainname

Just replace 'domainname' with your domain

You can also run some other options to find out more:

/dcname:domainname gets the PDC name for the domain /dsgetdc:domainname has flags for other information

Try nltest /? in your prompt to get more options! :)

share|improve this answer

From a command prompt, run gpresult. You will get:

  • General workstation and domain information
  • For both the computer and the user:
    • Distinguished name in AD and which DC the policy was applied from
    • Applied Group Policy objects
    • List of security groups a member of

Here is example output of running gpresult. You can also specify gpresult /z to get more detailed information.

share|improve this answer
Wow, gpresult /Z outputs a LOT of data. Thanks. – friederbluemle Feb 12 '14 at 9:53

DNS and DHCP are the best way to check since there can be Unix/Linux machines on the network managed by the AD domain controller or acting as the domain controller.

Plus, considering active directory is nothing more than Microsoft's version of Kerberos, LDAP, dhcp and dns. It would be better to understand and debug things at lower layers than layer 7+. This is because the operating system would preform these same requests and the underlining RFC for each protocol actually operates at a OSI level not the "insert favorite tool here" level.

One can go a step further and query the dhcp for options 6, 15, and 44 to get the domain name, domain name server, and Wins/NetBIOS name server.

Then using dns to check for the _kerberos._tcp, _kpasswd._tcp, _LDAP._TCP.dc._msdcs, and _ldap._tcp SRV records:

nslookup -type=srv _kerberos._tcp.EXMAPLE.COM
nslookup -type=srv _kpasswd._tcp.EXAMPLE.COM
nslookup -type=srv _ldap._tcp.EXAMPLE.COM
nslookup -type=srv _ldap._tcp.dc._msdcs.EXAMPLE.COM

.EXAMPLE.COM ::= value returned from dhcp option-1

This breaks down into three areas, two are protocol supported DNS-SD records:

  • _kerberos._tcp and _kpasswd._tcp (also under UNIX/Linux/OSX+some windows networks has _kadmin._tcp) are for kerberos
  • _ldap._tcp is for ldap (openldap, opendc, sun/oracle directory, ms ad) _LDAP._TCP.dc._msdcs is the Microsoft only extension to ldap to map the domain controller.
share|improve this answer

This will return your closest Domain Controller in Powershell:

Import-Module ActiveDirectory
(Get-ADDomainController -DomainName <Domain FQDN> -Discover -NextClosestSite).HostName
share|improve this answer

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.

share|improve this answer
+1 for simplicity. After obtaining the name of the DC, just ping it to get the IP. – Bigbio2002 Jan 9 '13 at 1:40

DNS should be there exactly for this purpose.

share|improve this answer
This is in my book the best way since active directory is nothing more than microsoft's version of Kerberos, LDAP, dhcp and dns. – Dwight Spencer Sep 1 at 15:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.