title: Having issues connecting to SQL instance using Windows credentials by computer name but can connect by FQDN
body: <p>This is my first post here so I do apologize for any formatting issues/inexperience all around.</p>
  
  <p>I have a SQL Server with two instances (a default instance and named instance). </p>
  
  <p>The SQL Server was initially joined to one domain but had later been joined to a new domain. </p>
  
  <p>When I connect to the named instance locally on the SQL Server (<code>MySQLServer\MyInstance</code>), I am able to login using Windows authentication. </p>
  
  <p>However when trying to connect to <code>MySQLServer\MyInstance</code> from another server on that domain, I get an error </p>
  
  <blockquote>
    <p>The target principal name is incorrect. Cannot generate SSPI context</p>
  </blockquote>
  
  <p>The Windows account is setup with SPN read/write permissions for the account running the services (returning "setspn -l newdomain\windowsaccount" (account running SQL services)) returns the expected SPN registries for the instances with the FQDN of the new domain. I can log in with SQL Server credentials on the remote server as well.</p>
  
  <p>However when I try connecting to the named instance using FQDN (i.e., <code>MySQLServer.newdomain.local\MyInstance</code>), it will let me in using Windows authentication. Has anyone seen this before or know what I could do to resolve? </p>
  
  <p>I've tried flushing the DNS and restarting both the SQL and remote server so all services should be accounted for in the restart (this is just an internal testing environment so no clients are affected :) ).</p>
  
  <p>Any ideas or tips would be appreciated!</p>