Private resolver and DNS name resolution issue

pv-scrosby 0 Reputation points
2025-08-07T12:05:02.3133333+00:00

We have private resolver setup with an inbound and outbound endpoint, the on-prem dns server CF is pointed to the inbound IP of the PR. When running an nslookup, the initial lookup returns the private IP, if you do a lookup immediately after the first it is reverting to the public IP so not sure where the issue. The PR vnet is linked to the private.x.x.x private dns zone as well. Everything seems like its setup correctly as far as I can tell as it does resolve the private IP initially then seems to lose its record and revert to public IP. Any suggestion you can offer will be much appreciated.

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michele Ariis 2,520 Reputation points MVP
    2025-08-07T13:55:15.69+00:00

    Hi, if your on-prem DNS sometimes resolves an Azure Private Endpoint to a public IP, it’s likely because you’re forwarding only the privatelink. sub-zone (e.g. privatelink.database.windows.net) to Azure. But clients usually query the public FQDN (like myserver.database.windows.net), which is a CNAME that ultimately points to the private IP. If your DNS resolves the public name through the Internet first, it caches the public A record, and future lookups “flip” to the wrong IP.

    -Fix-

    Delete the conditional forwarder for privatelink.database.windows.net and instead create a forwarder for the parent zone database.windows.net, pointing it to your Azure DNS Private Resolver’s inbound endpoint (e.g. 10.1.0.4). Then flush DNS on your servers and clients.

    This change ensures every step of the CNAME chain stays inside Azure, and your DNS will always return the correct private IP.

    -Checklist-

    – Private DNS zone is linked to the right VNet

    – Inbound endpoint is reachable from on-prem

    – No 8.8.8.8 or public resolvers in the forwarder list

    – TTL is default (10 min)

    – All on-prem DNS servers use the same forwarder

    After that, everything will resolve consistently to the private IP, no more flapping.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.