Unable to connect to sql database using System.Data.SqlClient 4.4.3 and hostname but ip works
问题 I have tried running this in a asp.net core 3.1 app inside a docker container based on mcr.microsoft.com/dotnet/core/sdk:3.1-bionic (Ubuntu 18.04). also tried with mcr.microsoft.com/dotnet/core/sdk:3.1-buster. I'm trying to connect to a database with the following code: using var connection = new SqlConnection(connectionString); connection.Open(); If i use an ip adress it works fine. If i run this outside of a docker container it works fine. If i run in a container and use System.Data