azure private dns zone: public name resolution is not being intercepted

Alexander Butz 25 Reputation points
2025-05-20T12:31:09.13+00:00

Hi all.

Setup

I have a vnet with multiple subnets, one for private endpoints, one for a APIM. APIM is fully vnet integrated in developer Tier (stv2.1). I want to do requests against a Service Bus Namespace (Premium) within one APIM API. All subnets have "Private endpoint network policy" set to "disabled". Service Bus Namespace has public access disabled. Private Endpoints show Provisioning state "Succeeded", Connection status "Approved" and Request/Response "Auto-Approved". I created a private DNS zone for each of my resources that are using a private endpoint, for example KeyVault and Service Bus Namespace with names privatelink.vaultcore.azure.net and privatelink.servicebus.windows.net. I created the dns entries in there using bicep. A records that point to the IP of the corresponding private endpoint.

expected behaviour

When resolving dns names using "Resolve-DnsName" on a windows VM that is hosted within the APIM subnet the IP of the private endpoint of the corresponding resource should be returned.

actual behaviour

When resolving dns names using "Resolve-DnsName" on a windows VM that is hosted within the APIM subnet the response does contain the CNAME record which points to the .privatelink.servicebus.windows.net domain but there is no private IP being returned. Only the public IP of the public domain.

things I tried

  • recreated link of private dns zone to vnet
  • recreated dns records in private dns zone
  • recreated entire private endpoint of SBNS

testing

PS C:\Users\temp-vm> Resolve-DnsName "<SBNS_Name>.servicebus.windows.net"

Name                           Type   TTL   Section    NameHost
----                           ----   ---   -------    --------
<SBNS_Name>.servicebus.windows.net CNAME  30    Answer     <SBNS_Name>.privatelink.servicebus.windows.net

<SBNS_Name>.privatelink.servicebus.windows.net CNAME  30    Answer     ns-prod-fra21-401.germanywestcentral.cloudapp.azure.com


Name       : ns-prod-fra21-401.germanywestcentral.cloudapp.azure.com
QueryType  : A
TTL        : 10
Section    : Answer
IP4Address : <public IP SBNS>


Name                   : germanywestcentral.cloudapp.azure.com
QueryType              : SOA
TTL                    : 202
Section                : Authority
NameAdministrator      : azuredns-hostmaster.microsoft.com
SerialNumber           : 1
TimeToZoneRefresh      : 3600
TimeToZoneFailureRetry : 300
TimeToExpiration       : 2419200
DefaultTTL             : 300



PS C:\Users\temp-vm> Resolve-DnsName "<SBNS_Name>.privatelink.servicebus.windows.net"

Name                           Type   TTL   Section    NameHost
----                           ----   ---   -------    --------
<SBNS_Name>.privatelink.servicebus.windows.net CNAME  22    Answer     ns-prod-fra21-401.germanywestcentral.cloudapp.azure.com


Name       : ns-prod-fra21-401.germanywestcentral.cloudapp.azure.com
QueryType  : A
TTL        : 2
Section    : Answer
IP4Address : <public IP SBNS>



PS C:\Users\temp-vm> nslookup "<SBNS_Name>.servicebus.windows.net"
Server:  UnKnown
Address:  168.63.129.16

Non-authoritative answer:
Name:    ns-prod-fra21-401.germanywestcentral.cloudapp.azure.com
Address:  <public IP SBNS>
Aliases:  <SBNS_Name>.servicebus.windows.net
          <SBNS_Name>.privatelink.servicebus.windows.net



PS C:\Users\temp-vm> Resolve-DnsName "<KV_Name>.vault.azure.net"

Name                           Type   TTL   Section    NameHost
----                           ----   ---   -------    --------
<KV_Name>.vault.azure.net CNAME  60    Answer     <KV_Name>.privatelink.vaultcore.azure.net


Name       : <KV_Name>.privatelink.vaultcore.azure.net
QueryType  : A
TTL        : 10
Section    : Answer
IP4Address : 10.250.134.4


As you can see, the exact same setup works fine for the Key Vault private endpoint, as well as for other resources like a storage account's blob storage (not listed here). I really don’t understand why I’m not getting the private IP in this case. Any help in understanding this would be greatly appreciated!

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
703 questions
{count} votes

Accepted answer
  1. Sampath 3,750 Reputation points Microsoft External Staff Moderator
    2025-05-28T12:17:49.81+00:00

    Hi @Alexander Butz ,

    I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this!

    Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others", I'll repost your solution in case you'd like to Accept the answer.

    Issue:

    When attempting to access a Service Bus Namespace (Premium) via Private Endpoint from a VNet-integrated APIM instance, DNS resolution was not returning the private IP.

    Despite having correct configurations for Private DNS Zones and Private Endpoints (all showing Approved and Succeeded states), DNS queries resolved to the public IP rather than the private one. The issue persisted even after verifying route tables, NSGs, and the correctness of DNS zone names and records.

    Solution:

    The root cause was traced to a Private DNS Resolver that was connected to a peered VNet. According to Azure Support, if this DNS Resolver is not configured correctly, it can interfere with private DNS resolution, even in other connected VNets.

    Once this misconfigured DNS Resolver was identified, it became clear why the correct private IPs were not being returned for specific services (like Service Bus), while others (like Key Vault) were resolving correctly.


    Please click Accept Answer and kindly upvote it so that other people who faces similar issue may get benefitted from it.


2 additional answers

Sort by: Most helpful
  1. Alex Burlachenko 10,565 Reputation points
    2025-05-22T15:03:32.48+00:00

    Hi Alexander,

    Thanks for your patience while we work through this tricky issue.

    Since you've confirmed the route table change didn't help and the problem affects both subnets equally, let's focus on some Service Bus-specific behaviors that might explain what's happening.

    One thing that's different about Service Bus compared to Key Vault is how it handles DNS resolution. When you create a private endpoint for Service Bus, Azure actually creates two DNS records:

    A CNAME record pointing to the privatelink address

    An A record with the private IP in your privatelink zone

    The issue you're seeing where it resolves to the public IP suggests the private DNS zone isn't being properly consulted during name resolution. Here are some specific things to check:

    First, could you verify if the private endpoint's network interface has the correct IP address? You can find this by:

    Going to your private endpoint resource in Azure portal

    Clicking on the network interface under "Network Interface"

    Checking that the private IP matches what's in your privatelink.servicebus.windows.net DNS zone

    Sometimes there can be a mismatch here that causes resolution to fail. The Microsoft docs explain this in more detail: Private Endpoint DNS Configuration

    Another test worth trying is to query the private DNS zone directly from your VM:

    Resolve-DnsName "<SBNS_Name>.privatelink.servicebus.windows.net"
    

    If this returns the correct private IP but the regular servicebus.windows.net name doesn't, it confirms your private zone is working but the linkage between the public and private names isn't happening properly.

    One last thought - have you checked if there are any network security groups (NSGs) that might be blocking DNS traffic to 168.63.129.16? This is Azure's internal DNS resolver that handles the private zone lookups. Even though you've checked routing, sometimes NSG rules can interfere.

    I know this is a lot to check, but we'll get to the bottom of it! Let me know what you find with these additional tests.

    Best regards,
    Alex
    P.S. If my answer help to you, please Accept my answer
    PPS That is my Answer and not a Comment
    https://ctrlaltdel.blog/
    

  2. Alexander Butz 25 Reputation points
    2025-05-28T10:43:17.21+00:00

    We found a private DNS resolver which is connected to one of the peered VNets. According to Azure Support, this can interfere with private DNS if it is not configured correctly.

    0 comments No comments

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.