I've configured a remote Sql server on host machine. I have performed the follwing steps : Under Remote Server Connections, check the box against "Allow remote connections to this server". Make sure that the TCP/IP Protocol Name is Enabled. Navigate to the IP Addresses tab and scroll down to the section named "IPAII". If the TCP Dynamic Ports is set to 0 (indicates the Database Engine is listening on dynamic ports), then remove the 0 and set it to blank. Update the value for TCP Port to 1433. Restart the service. Windows Firewall setting inbound rule TCP, port 1433 , Allow the connection
Using this setup I'm able to connect from SSMS using aa.aaa.aa.aaa\SQLEXPRESS and from c# app using the following aa.aaa.aa.aaa\SQLEXPRESS,1433. I would like also to be able to connect using the host name instead of ip address. Is this possible? I have tried in SSMS using hostname\SQLEXPRESS or hostname\SQLEXPRESS,1433 but it doesn't connect and an error is shown saying : 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: TCP Provider, error: 0 - The wait operation timed out.) (Microsoft SQL Server, Error: 258)
I should be able to connect also via the machine name. For local sql server it works to connect via hostname\sqlinstance.