When trying to connect to a database using the default instance name [server]\[instance] I get:
Cannot connect to RT-WEB\SQLEXPRESS
--> A network-related or instance-specific error occurred while establishing a connection to SQL server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)(Microsoft SQL Server)
But if I try to connect to the same server, without including the instance, I am able to connect. There is only 1 instance of SQL on this server. This wouldn't be an issue, but I am trying to create a replication subscription for this server, and it wants the instance name when establishing a connection. Error from that screen:
Cannot connect to RT-WEB
-->SQL Server replication requires the actual server name to make a connection to the server. Specify the actual server name, 'RT-WEB\SQLEXPRESS'. (Replication.Utilities)
It is the case that RT-WEB is an alias from the hosts file, but when I use the server's IP I get the exact same error, including suggested server name.