Azure SQL connectivity error 10060 example : a DNS resolution issue.
Published Jun 27 2022 02:28 AM 12.4K Views
Microsoft

Issue:

When connecting from inside Azure (an Azure Virtual Machine) to Azure SQL Server. All connections failed with error:

MSSQLSERVER_10060 - SQL Server | Microsoft Docs

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 - A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.) (.Net SqlClient Data Provider)

------------------------------
For help, click: https://docs.microsoft.com/sql/relational-databases/errors-events/mssqlserver-10060-database-engine-...

------------------------------
Error Number: 10060
Severity: 20
State: 0

Scenario:

All connections are via the Private Endpoint, after disabling the public access (Public Endpoint) on the Database. As per the screenshot below (Azure Portal -->Azure SQL Server--> Networking):

tarashee_1-1656321387131.png

 

 

 

Troubleshooting steps:

Run Connectivity checker PowerShell script , you can find the script on below URL:

GitHub - Azure/SQL-Connectivity-Checker: This PowerShell script will run some connectivity checks fr...

 

Part of the script is validating the DNS resolution of Azure SQL Server FQDN. Below is part of the script execution result:

Validating DNS record for mysqlservername.database.windows.net

Could not find DNS record in local cache (while excluding hosts file)

Could not find DNS record in local cache (while including hosts file)

Found DNS record in DNS server (IP Address:104.40.168.105)

Error getting DNS record in Open DNS (mysqlservername.database.windows.net : This operation returned because the timeout period expired)

 

 

The IP address 104.40.168.105 is one of the listed Public gateway IP addresses,  as per below URL:

https://docs.microsoft.com/en-us/azure/azure-sql/database/connectivity-architecture?view=azuresql#ga...

So, the DNS is resolving the Public IP of the Gateway not the private endpoint IP.

 

Resolution:

Fix the internal naming resolution service error. For more information:

Troubleshooting DNS Servers | Microsoft Docs

https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-name-resolution-for-vms-and-...

Co-Authors
Version history
Last update:
‎Jun 27 2022 02:28 AM
Updated by: