How to Use the nltest Command in Windows 11 to Test Domain Controller Trust and Secure Channels

When troubleshooting enterprise authentication failures, Group Policy application delays, or single sign-on anomalies on domain-joined Windows 11 devices, administrators require rapid insight into Netlogon communications. The native command-line utility nltest queries the Netlogon service directly, verifying Active Directory trust relationships, querying domain controller discovery routines, and testing secure channel integrity without requiring bulky administrative consoles.

Core Diagnostic Switches

The nltest executable is bundled natively in Windows 11 system directories. Common administrative operations utilise the following parameter combinations:

Command Syntax Diagnostic Purpose Primary Application
nltest /sc_query:corp.example.com Queries the status of the workstation’s secure channel to the domain. Verifying machine account password synchronisation and trust health.
nltest /sc_verify:corp.example.com Forces immediate verification and testing of the secure channel. Validating authentication readiness after network or certificate changes.
nltest /sc_reset:corp.example.com\DC01 Resets the secure channel and targets a specific domain controller. Recovering broken machine trust or redirecting away from an impaired DC.
nltest /dsgetdc:corp.example.com Queries the DC locator mechanism using DNS and NetBIOS. Auditing Active Directory site awareness and subnet assignment accuracy.
nltest /dclist:corp.example.com Enumerates all registered domain controllers for the domain. Validating directory service redundancy across wide-area networks.

Step-by-Step Diagnostic Procedures

  1. Open an Elevated Command Prompt: Press Win + X and choose Terminal (Admin). Ensure the session runs with administrative privileges.
  2. Querying the Domain Controller Locator: Discover which DC your workstation communicates with and verify that the local client subnet matches the assigned Active Directory site:
    nltest /dsgetdc:example.com /kdc
    Inspect the returned fields: DC Name, Our Site Name, and Client Site Name. If Client Site Name differs from Our Site Name, the client is traversing network boundaries to reach a non-optimal site, signalling a misconfigured subnet definition in Active Directory Sites and Services.
  3. Validating Machine Account Trust: Test whether the cryptographic secure channel between Windows 11 and Active Directory remains intact:
    nltest /sc_query:example.com
    A healthy response returns:
    Flags: 30 HAS_IP  HAS_TIMESERV
    Trusted DC Name \DC01.example.com
    Trusted DC Connection Status Status = 0 0x0 NERR_Success
    The command completed successfully
    Any return code other than NERR_Success indicates an expired machine password or trust break.
  4. Resetting and Re-establishing Broken Trust: If the secure channel displays authentication failures, execute an immediate reset against a specific responsive DC:
    nltest /sc_reset:example.com\DC02.example.com
    This forces Netlogon to regenerate session keys and re-authenticate without requiring unjoining and rejoining the domain.

Querying Forest Trust Relationships

To inspect multi-domain enterprise environments and verify external or cross-forest trusts, run:

nltest /domain_trusts /all_trusts

This command outputs the complete trust hierarchy, identifying whether trusts are transitive, inbound, outbound, or bidirectional. It provides administrators with immediate clarity when investigating cross-forest permission denials.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.