SQL connection failed with SSMS on workgroup when using FQDN

matteu31 512 Reputation points
2026-08-21T20:10:53.5166667+00:00

Hello,

When I try to connect locally (or remotely) with SSMS on my SQL server with hostname "localhost" or "hostname" it works fine.

However, if I try with "hostname.domain.com" it doesn't work I have error 18452 (Login failed. The login is from an untrusted domain and cannot be used with Windows authentication).

Can you explain me if I can solve it or it's by design ?

SQL Server Database Engine
0 comments No comments

Answer accepted by question author
Rukshan edirisinghe 0 Reputation points
2026-08-22T11:21:10.91+00:00

Hi@matteu31 ,

Short answer: this is expected behavior for Windows Authentication in a workgroup when you connect by FQDN, and yes it can be worked around.

Why it happens: connecting by "localhost" or "hostname" uses NTLM, which works locally in a workgroup. When you connect by "hostname.domain.com", the client instead tries to get a Kerberos ticket for that name. Kerberos needs a domain controller and a registered SPN, and your server is in a workgroup with neither, so authentication can't validate your Windows principal, and you get 18452 (untrusted domain / unrecognized principal). Error 18452 specifically means the login uses Windows Authentication, but Windows can't verify the account, which is exactly the workgroup case.

Ways to solve it:

Use SQL Server Authentication for the FQDN connection. Enable Mixed Mode on the server, create a SQL login, and connect with that instead of Windows auth. This is the clean fix in a workgroup and removes the Kerberos dependency entirely.

Keep using Windows auth by connecting with the hostname or IP instead of the FQDN, so it stays on NTLM. For remote machines, this requires the same username and password to exist as a local account on both the client and the server (workgroup NTLM pass-through).

So it's not a bug. Windows auth over an FQDN relies on domain infrastructure that doesn't exist in a workgroup. Use SQL auth for FQDN, or stick to hostname/IP with a mirrored local account for Windows auth.

Was this answer helpful?

2 people found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Marcin Policht 103.7K Reputation points MVP Volunteer Moderator
    2026-08-21T20:44:13.9633333+00:00

    AFAIK, that's by design. As per https://learn.microsoft.com/en-us/sql/relational-databases/errors-events/mssqlserver-18452-database-engine-error?view=sql-server-ver17 this behavior is expected when you use the SQL Server's FQDN with Windows Authentication.

    The hostname can work because Windows can establish the connection using local/workgroup credentials. When you specify hostname.domain.com, Windows Authentication attempts to authenticate the Windows identity against the domain associated with that FQDN. A workgroup computer does not have the domain trust relationship required for that authentication, so SQL Server receives credentials that cannot be validated and returns 18452.

    You can obviously work around this by using hostname, SQL Server Authentication, if enabled and permitted, or by running SSMS under domain credentials from the workgroup computer, for example with runas /netonly using a domain account. The latter should allow you to use remote Windows authentication with domain credentials even though the workstation itself remains in the workgroup.


    If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.

    hth

    Marcin

    Was this answer helpful?


  2. Erland Sommarskog 136.6K Reputation points MVP Volunteer Moderator
    2026-08-21T20:34:12.0333333+00:00

    Windows authentication in workgroups are always problematic, since there is no AD to talk to. As you may know, the only way authentication can work is that username and password are the same. That is not what you are running into here. But it could be something else that is also due to the lack of an AD controller to broker things.

    I will need to confess that I don't know how you can connect a computer in a workgroup to a domain, so I cannot set up a test.

    But thinking aloud. You have logged on to COMPUTER1, and you are now connecting to COMPUTER2.domain.com, and these two names are not in the same domain. But if you would instead log on to COMPUTER1.domain.com, maybe it would work. Not that I know how you would do that in Windows...

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.