Photo by Markus Spiske on Pexels.com

Issue Description

There are situations when you need to find the domain controller used by client machine for authentication, one of those situation is when you make updates to your Active Directory Sites.

you ran set l command and still see old domain controller name

Cause

There are 2 commands which can be used :

  • Set L command : This shows cached information, hence it may not be accurate.
C:\Windows\system32>set l
LOCALAPPDATA=C:\Users\Sourabh\AppData\Local
LOGONSERVER=\\DC02.learntechfuture.com

C:\Windows\system32>



  • NLTest /DSGETDC – This command should be used, because this shows the realtime information.
C:\Users\Sourabh>NLTEST /DSGETDC:learntechfuture.com
           DC: \\DC01.learntechfuture.com
      Address: \\192.168.114.1
     Dom Guid: 971768b9-91fa-11a5-jdi1c-c2c0a438abf9
     Dom Name: learntechfuture.com
  Forest Name: learntechfuture.com
 Dc Site Name: HK
        Flags: PDC GC DS LDAP KDC TIMESERV GTIMESERV WRITABLE DNS_DC DNS_DOMAIN DNS_FOREST FULL_SECRET WS DS_8 DS_9 DS_10 KEYLIST
The command completed successfully

C:\Users\Sourabh.Jha>

Fix

Make use of nltest command, run this on the member server, this will show real time info

NLTEST /DSGETDC:domainname
C:\Users\Sourabh>NLTEST /DSGETDC:learntechfuture.com
           DC: \\DC01.learntechfuture.com
      Address: \\192.168.114.1
     Dom Guid: 971768b9-91fa-11a5-jdi1c-c2c0a438abf9
     Dom Name: learntechfuture.com
  Forest Name: learntechfuture.com
 Dc Site Name: HK
        Flags: PDC GC DS LDAP KDC TIMESERV GTIMESERV WRITABLE DNS_DC DNS_DOMAIN DNS_FOREST FULL_SECRET WS DS_8 DS_9 DS_10 KEYLIST
The command completed successfully

C:\Users\Sourabh.Jha>

Thank you for reading !