Configuring DNS with Azure VPN Client and Private DNS Resolver to Resolve Private Endpoint DNS

Rémi Céraline 20 Reputation points
2025-01-21T18:19:31.8166667+00:00

Hi,

I am attempting to configure a VPN client to resolve Azure DNS queries automatically.

The infrastructure is illustrated in the attached diagram.

diagrams-VPN

My goal is to run the following command on my laptop:

nslookup stvpn20250120.blob.core.windows.net

and retrieve the private IP address of the storage account.

Here is the setup I currently have:

  • A VPN Gateway
  • A Private DNS Resolver with an inbound endpoint
  • A storage account with a private endpoint

However, I consistently receive the public IP address when performing the nslookup query.

When I explicitly specify the DNS server IP address in the command, as shown below, I can successfully retrieve the private IP address:

nslookup stvpn20250120.blob.core.windows.net 10.0.3.4

I have modified my VPN profile with the configuration below. The VPN Gateway is set up to use OpenVPN, and everything functions as expected except for DNS resolution.


<AzVpnProfile xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://schemas.datacontract.org/2004/07/">
...
  <clientconfig>
    <dnssuffixes>
        <dnssuffix>.azurecr.io</dnssuffix>
        <dnssuffix>.azuredatabricks.net</dnssuffix>
        <dnssuffix>.azurestaticapps.net</dnssuffix>
        <dnssuffix>.1.azurestaticapps.net</dnssuffix>
        <dnssuffix>.2.azurestaticapps.net</dnssuffix>
        <dnssuffix>.azurewebsites.net</dnssuffix>
        <dnssuffix>.scm.azurewebsites.net</dnssuffix>
        <dnssuffix>.blob.core.windows.net</dnssuffix>
        <dnssuffix>.database.windows.net</dnssuffix>
        <dnssuffix>.datafactory.azure.net</dnssuffix>
        <dnssuffix>.dfs.core.windows.net</dnssuffix>
        <dnssuffix>.file.core.windows.net</dnssuffix>
        <dnssuffix>.postgres.database.azure.com</dnssuffix>
        <dnssuffix>.vault.azure.net</dnssuffix>
        <dnssuffix>.vaultcore.azure.net</dnssuffix>
        <dnssuffix>.wvd.microsoft.com</dnssuffix>
        <dnssuffix>.azurecontainerapps.io</dnssuffix>
    </dnssuffixes>
    <dnsservers>
      <dnsserver>10.0.3.4</dnsserver>
    </dnsservers>
  </clientconfig>
...
</AzVpnProfile>


What am I missing? Is it possible to configure automatic DNS resolution to the Private DNS Resolver with a Point-to-Site VPN setup?

Thank you for your help.

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
720 questions
Azure VPN Gateway
Azure VPN Gateway
An Azure service that enables the connection of on-premises networks to Azure through site-to-site virtual private networks.
1,622 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,047 questions
Azure Private Link
Azure Private Link
An Azure service that provides private connectivity from a virtual network to Azure platform as a service, customer-owned, or Microsoft partner services.
529 questions
{count} votes

Accepted answer
  1. Praveen Bandaru 75 Reputation points Microsoft Vendor
    2025-01-24T10:33:55.8533333+00:00

    Hello Rémi Céraline

    Greetings!

    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.

    Please click "Accept" the answer as original posters help the community find answers faster by identifying the correct answer.

    Issue: Configuring DNS with Azure VPN Client and Private DNS Resolver to Resolve Private Endpoint DNS

    Resolution:

    From your research, the issue might be related to the Name Resolution Policy Table (NRPT) in Windows. When you run the command Get-DnsClientNrptPolicy, it displays the list of domain names with the correct DNS server assigned, but the resolution still doesn’t work as expected.

    User's image

    You adjusted the VPN interface to have the highest priority by assigning it a value of 1 for the InterfaceMetric.

    It appears that your machine is using the DNS from the default network interface, which is 192.168.2.1. As a result, the default networking interface resolution is directing traffic to the public network. Additionally, it seems that nslookup was ignoring the NRPT.

    Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.

    Thanks,

    Praveen

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.