// SQL Server error reference

SQL Server error 18452: Login is from an untrusted domain

Windows authentication failed: the client's Windows identity couldn't be verified by the server, often a domain trust, Kerberos or local-account problem.

Error number
18452
Severity
14
Category
Connection and login
Error message
Login failed. The login is from an untrusted domain and cannot be used with Integrated authentication.%.*ls

What it means

With Windows (integrated) authentication, SQL Server relies on Windows to vouch for the client. Error 18452 means Windows couldn't authenticate the caller to the server: the account isn't from a domain the server trusts, or the security handshake (Kerberos or NTLM) failed.

Common causes

  • The client machine or user is not in the server's domain or a trusted domain, for example a workgroup laptop or a different forest without a trust.
  • The server is configured for Windows authentication only and the client tried a SQL login.
  • Kerberos problems such as missing or duplicate SPNs, or a clock difference between client and domain controller.
  • Connecting by IP address or a DNS alias that doesn't match the server's SPN, so the handshake falls back and fails.
  • Loopback protection when connecting to the local machine by a fully qualified name or alias.

How to fix it

  1. If you meant to use a SQL login, enable SQL Server and Windows Authentication mode on the server (Properties, Security) and restart the service.

  2. Connect from a machine and account in the server's domain or a trusted domain, or create a SQL login for this client.

  3. Check the SPNs for the SQL Server service account with setspn -L <service account> and fix missing or duplicate entries; Microsoft's SQLCheck tool reports these.

  4. Connect using the server's real host name rather than an IP address or alias.

Related errors

More connection and login errors

The code and message text are from the Microsoft Database Engine events and errors reference. Browse the full SQL Server error list or search every database error.

// fewer errors, faster fixes

Work on SQL Server in SQLly

A native SQL client for macOS, Windows and Linux with schema-aware IntelliSense, guardrails for risky statements and clear error messages, for SQL Server and the other databases you use.