Take the 2-minute tour ×
Server Fault is a question and answer site for professional 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
add comment

5 Answers 5

up vote 48 down vote accepted

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 actual domain name i.e. contoso.com. Read more here.

share|improve this answer
add comment

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
add comment

This will return your closest Domain Controller in Powershell:

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

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

  • General workstation and domain information
  • Computer distinguished name in AD and which DC the policy was applied from
  • List of computer applied Group Policy objects
  • List of security groups the computer is a member of
  • User distinguished name in AD and which DC the policy was applied from
  • List of user applied Group Policy objects
  • List of security groups the user is 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 at 9:53
add comment

Your Answer

 
discard

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.