Hello @Prince Rastogi Admin Account ,
Welcome to Microsoft Q&A Platform. Thank you for reaching out & hope you are doing well.
It's important to correctly configure your DNS settings to resolve the private endpoint IP address to the fully qualified domain name (FQDN) of the connection string.
You can use the following options to configure your DNS settings for private endpoints:
- Use the host file (only recommended for testing)
- Use a private DNS zone.
- Use your DNS forwarder (optional).
At the moment, you are using the host file method which is only recommended for testing.
For on-premises workloads to resolve the FQDN of a private endpoint, you must use a DNS forwarder in Azure, which in turn is responsible for resolving all the DNS queries via a server-level forwarder to the Azure-provided DNS 168.63.129.16.
Reference : https://learn.microsoft.com/en-us/azure/private-link/private-endpoint-dns#on-premises-workloads-using-a-dns-forwarder
If you check the table in Name resolution for resources in Azure virtual networks article, you can find the below:
Currently, there is no other way to accomplish this requirement as conditional forwarding isn't natively supported for Azure Private DNS but Azure Private DNS Zone resolution from On-premise is planned and is on the roadmap. You can vote for this feature in the below forum:
https://feedback.azure.com/d365community/idea/f50bd7e3-8526-ec11-b6e6-000d3a4f0789
Hence, at the moment, you need to configure your on-premises DNS solution to forward DNS traffic to Azure DNS via a conditional forwarder that references the DNS forwarder deployed in Azure for resolution of private endpoint IP address from your on-premises.
Kindly let us know if the above helps or you need further assistance on this issue.
----------------------------------------------------------------------------------------------------------------
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.