SQLServer – “The login is from an untrusted domain”

We received the following error when attempting to connect to a SQLServer database from SQL Management Studio this morning.

image

Login failed.  The login is from an untrusted domain and cannot be used with Windows Authentication.  (Microsoft SQL Server, Error: 18452

We have never seen this issue before and have been connecting to this server in the same way without issue for months.  With some investigation/research found the following error in the SQLServer logs which is a little more helpful:

Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. [CLIENT: 1.2.3.4]
Error: 18452, Severity: 14, State: 1.
SSPI handshake failed with error code 0x80090311, state 14 while establishing a connection with integrated security; the connection has been closed. Reason: AcceptSecurityContext failed. The Windows error code indicates the cause of failure. No authority could be contacted for authentication.   [CLIENT: 1.2.3.4]

Given the above error we suspected our domain controller was having issues.  Sure enough the following nltest command run on the database server showed it couldn’t find the logon server:

image

So we rebooted our domain controller and the issue was resolved.

The odd part of this problem was only some users couldn’t login while others still could.  We assumed some form of credential or authentication caching caused this inconsistency.

I hope this post makes it easier for others to find/fix this problem.  If so or you have further questions please leave a comment below.

Happy Coding!

Leave a Reply