Using Host file to connect to Named Instance

  • Hello,

    I have setup a reference in the hosts file on my server that points to itself. This SQL server has a named instance on it. When trying to then connect SSMS to the SQL Server using the name as defined in the hosts file I get the following error when using windows authentication. If I use SQL login it works fine:

    TITLE: Connect to Server

    ------------------------------

    Cannot connect to sqlprod01\FAILOVERDBSERVER.

    ------------------------------

    ADDITIONAL INFORMATION:

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

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=18452&LinkId=20476

    ------------------------------

    BUTTONS:

    OK

    ------------------------------

    I am logged on as the local administrator. This machine is not part of a domain, and is stand alone.

    Does anyone have any ideas; I did a quick search and came up with only dead/old links 🙁

    Thanks in advance

    Troy

  • Hello,

    You must add aliases in SQL Server Configuration Manager (SQL Native Client 10.0 Configuration).

    :exclamation: TCP/IP must be enabled (SQL Server Configuration Manager => SQL Server Network Configuration => Protocols for MSSQLServer).

    Jeff.

  • Thanks Jeff for your response; I have tried this but to no avail.

    Additionally I have removed the host file from the equation, so while logged onto the box as the local administrator (which is sysadmin), and connecting to [IPAddress]\[InstanceName] and using Windows Authentication it continually raises that message.

    However if I connect with [servername]\[InstanceName] it works fine.

    Bizarre. So connecting via the server name it works, whereas a host reference or even the direct IP address does not work (raising the above error).

    Any thoughts?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply