Not resolving private dns zone over point to site VPN connection into Azure

John Fox 21 Reputation points
2020-06-24T08:53:42.657+00:00

Having issues getting a private DNS setup, attached to a vnet, to resolve over a point to site VPN connection.

My point to site VPN connection is working and I am able to ping the IP and get to IIS on the server. I've set the private DNS up and it's attached to the vnet with the machines automatically registering in the DNS fine. The domain resolves fine from within the vnet/vm but not from across the point to site VPN.

I'm deploying the setup using an ARM template and have the following dependencies to see if that makes a difference:

vnet - depending on a couple of NSGs and the private DNS zone

virtual network gateway - depending on the gateway IP, vnet and the private dns zone

I've waited for everything to deploy and then downloaded, installed and connected the VPN. Connects fine but just no DNS resolution from the private zone.

Anyone any ideas?

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
634 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,461 questions
Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,309 questions
{count} votes

14 answers

Sort by: Most helpful
  1. Umesh 6 Reputation points
    2021-09-07T15:54:37.45+00:00

    I am having same problem. I have a private dns configured to access azure container registry and I am planning to use the same to access VMS from point-to-site vpn connection. I am able to connect to VMs using IP address, but name resolution doesn't happen. I am using MacOS desktop and using MacOS vpn client and not the Azure VPN client. Any suggestions ?

    0 comments No comments

  2. The Architect 1 Reputation point
    2022-01-28T21:24:53.077+00:00

    I love it when I read a trend of posts that programmers and developers trying to do a simple fix by hacking codes and files all over the place for days and at the end they end up with a mess that ain't working.

    There is absolutely no such thing as DNS issue for Azure P2S VPN, you just didn't do it right.

    All you need to do is this,
    On the VNET that you plan to have your VPN's GatewaySubnet, make sure you configure your DNS server IP. If it is on a VM in the same tenancy or OnPrem or internal IP of azure firewall when you use it as DNS proxy.

    If you didn't do the previous step before building your azure vpn gateway, then you need to rebuild it after configuring the DNS.

    That's it.


  3. Scott Barclay 1 Reputation point
    2022-02-28T20:37:14.517+00:00

    If you have a Domain Controller / DNS server hosted in the environment, change it from Default (Azure-provided) to Custom and specify that DNS server.

    0 comments No comments

  4. Michael McMaster 11 Reputation points
    2022-02-28T20:49:56.26+00:00

    I don't. I also found the following, that says the only way to do it with Azure Private DNS is to set up a DNS server as a forwarder.

    https://github.com/MicrosoftDocs/azure-docs/issues/56217
    https://stackoverflow.com/questions/70450341/azure-private-dns-configuration-not-working-with-p2s-vpn

    So it seems my scenario is not supported.

    Thanks for the replies!

    0 comments No comments

  5. Gal G 1 Reputation point Microsoft Employee
    2022-03-08T08:35:17.58+00:00

    After long journey of figuring out how to make it work, here is my solution which is based on all previous comments:

    1. You need to add both to the XML file, DNSsuffix and DNS server IP. Suffix will contain all the domains that you would like redirecting to your VPN DNS server.
      <clientconfig>
      <dnssuffixes>
      <dnssuffix>.x.com</dnssuffix>
      <dnssuffix>.y.om</dnssuffix>
      </dnssuffixes>
      <dnsservers>
      <dnsserver>DNS_FORWARDER_IP</dnsserver>
      </dnsservers>
      </clientconfig>
    2. Create DNS server/forwarder in your Azure ENV. I simply used Azure firewall as a forwarder cause I wanted to keep it Azure native.
    3. Add DNS private zone and make sure it is connected to your VPN gateway network. After creating it, CNAME resource records will automatically updated to an alias with the prefix
      'privatelink'. So when accessing your resource xxx.azure.com from the VPN, it will redirect you automatically to your private DNS record xxx.privatelink.azure.com.

    Reference: https://learn.microsoft.com/en-us/azure/purview/catalog-private-link-name-resolution

    Gal