I created two container on the same network and one of them as a Sql Server instance running. In the other container (with SQL Tools) i'm able to connect to the SQL using the IP Address, but if i swith to machine name it fails.
I already tried do ping the machine and the dns is solving the right IP, i also tried dnslookup and it's also working. Does anyone as a clue on how to fix this?
Full test scenario:
Created new network
docker network create --driver=bridge specsnetRun SQL Container
docker run -e 'ACCEPT_EULA=Y' -e 'SA_PASSWORD=Password!123456' -p 1401:1433 -d --name=TestDBServer --net=specsnet --rm microsoft/mssql-server-linux:latestRun New Container with SQL Tools (to test connection)
docker run -it --net=specsnet --rm --entrypoint "bash" mcr.microsoft.com/mssql-tools:latestLoaded some tools for troubleshooting (into SQL Tools container)
apt-get update | apt-get install telnet -y | apt-get install iputils-ping -y | apt-get install dnsutils -y | apt-get install nmap -y | apt-get install nano -yTest Connection with IP (Success - IP was 172.18.0.2)
sqlcmd -S tcp:172.18.0.2,1433 -U sa -P 'Password!123456'Test Connection with Name (Fails)
sqlcmd -S tcp:TestDBServer,1433 -U sa -P 'Password!123456'