Why are we receiveing error "ConnectionOpen (gethostbyname()())" when connecting to SQL Server?

Article ID: 94
Category: Database
Updated: 2022-06-07

When the EventSentry database is located in a SQL Server instance, then you can point to the instance by using the TCP port number instead of using the instance name. This will usually solve all connection problems.

To determine the TCP port of the instance do the following:

  • Open SQL Server Enterprise Manager
  • Right-click the instance and select "Properties"
  • Click "Network Configuration"
  • Locate "TCP/IP" in the list of "Enabled protocols" and select it
  • Click "Properties" and note down the "Default Port" number

Now change the connection string so that the instance name is not included anymore, but instead the hostname should be followed by a comma and the port number:

server=HOSTNAME,3333

where "3333" is the TCP port of the instance. Test, save and push the configuration to the remote hosts.