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

2 answers

Sort by: Most helpful
  1. Marcin Policht 103.6K 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.