Issue with resolving hostnames while connected to p2s Azure VPN

alex2015 1 Reputation point
2020-08-11T07:14:00.533+00:00

Hi all. Our company has different web apps and web servers hosted at Azure. All people connect to private IPs of those resources via Azure p2s VPN. Everything was good but on some Windows 10 workstations we faced an issue. Some howe it resolves not private but public IPs. Looks like DNS settings of the network adapter somehow overrides DNS settings of the VPN connection.
If set Azure DNS at the network adapter settings it resolves private IP but the workstation doesn't have access to the rest of the world. If I add 1.1.1.1 or 8.8.8.8 to the network adapter settings additionally (Azure DNS as primary DNS and 8.8.8.8 as secondary DNS) it starts to resolve public IP again.

Is there any way to use the DNS of the VPN connection when need to access Azure resources and the DNS of the network adapter when need to access the rest of the world? Does anybody know how to resolve this issue?

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,524 questions
{count} votes

6 answers

Sort by: Most helpful
  1. Lab Coat1 6 Reputation points
    2022-08-26T14:57:50.74+00:00

    Same problem.
    Dns is configured in the vnet
    When connected, I see the server in powershell
    Set the interface metric to 1
    Is now in the ipconfig/all before the ethernet adapter.
    route print still shows a larger metric number than the ethernet routes
    nslookups work fine if I specific the dns server in the nslookup command
    AzureVpnCxn.log shows the proper assigned DNS Server
    ipconfig/all does not show dns for the vpn interface (as mentioned in the docs)

    Windows version 10.0.17763.3287


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.