1

I set up a VM server computer on AWS EC2 and got a SQL Express Server running on it on port 1433. I made sure to allow TCP/IP requests and allowed TCP port 1433 through the firewall along with UDP port 1434. I then created a second VM computer on AWS EC2 - same VPC, security group, and subnet - and installed SSMS.

I also made sure that to put the two computers in the same workgroup in windows, and made them discoverable.

I can connect to the SQL server I created via IP and port number (e.g. IPAddress\Hostname,1433) but I can't connect with just the hostname. Any ideas to what I'm missing here? I followed the documentation here to the letter and it doesn't seem to work.

I've also tried having the two EC2 VM computers ping each other by computer name and it doesn't work either.

  • When you have a connection method that works, why is using just the hostname so important? – Aaron Bertrand Jun 20 '18 at 17:31
  • I'm trying to emulate an on-premise network, where a user would presumably access the database with only the hostname. This is for testing purposes. – Goalaso Jun 20 '18 at 17:35
  • How about adding alias in SQL Server Configuration Manager? You may find it under SQL Native Client configuration – Grzegorz Lewicki Jun 21 '18 at 11:25
  • I tried adding the alias. Didn't work, but thanks for the suggestion. – Goalaso Jun 21 '18 at 16:03
  • A user should presumably access the database using the method that works. :-) Sometimes you'll have a named instance, sometimes you'll have an Azure SQL DB, sometimes you'll have a read-only secondary connection, sometimes you'll need to access by IP instead of machine name or FQDN. These all affect the connection string. Users need to adapt or, I guess, not connect. – Aaron Bertrand Jun 26 '18 at 11:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.