Custom DNS entries in the xml configuration file required for P2S VPN setup

Mudit Mittal 21 Reputation points
2020-10-09T08:43:54.033+00:00

I am having similar issue while configuring the Azure VPN Client & It ended up with error "Connecting to VPN server failed with exception: No such host is known". Can I check if we can add custom DNS entries in the xml configuration file required for P2S VPN setup. Thanks

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,379 questions
0 comments No comments
{count} votes

Accepted answer
  1. suvasara-MSFT 10,001 Reputation points
    2020-10-19T23:20:52.767+00:00

    @Mudit Mittal , I tried altering the custom DNS config with no error. Let us know if you are still looking for help here.


3 additional answers

Sort by: Most helpful
  1. suvasara-MSFT 10,001 Reputation points
    2020-10-09T09:54:29.597+00:00

    @Mudit Mittal , You can modify the downloaded profile XML file and add the <dnsservers><dnsserver> </dnsserver></dnsservers> tags,

    <azvpnprofile>  
    <clientconfig>  
      
     <dnsservers>  
     <dnsserver>x.x.x.x</dnsserver>  
            <dnsserver>y.y.y.y</dnsserver>  
     </dnsservers>  
          
    </clientconfig>  
    </azvpnprofile>  
    

    Note: The OpenVPN Azure AD client utilizes DNS Name Resolution Policy Table (NRPT) entries, which means DNS servers will not be listed under the output of ipconfig /all. To confirm your in-use DNS settings, please consult Get-DnsClientNrptPolicy in PowerShell.

    Ref : https://learn.microsoft.com/en-us/azure/vpn-gateway/openvpn-azure-ad-client#faq

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

  2. Mudit Mittal 21 Reputation points
    2020-10-09T12:34:02.52+00:00

    31189-capture.jpg

    I tried adding the custom DNS, but its not working as expected. :-(

    0 comments No comments

  3. Ian Dunbar 1 Reputation point
    2022-09-22T13:39:15.477+00:00

    Reason the screenshot from MuditMittal-8091 doesn't work is the dnsserver tags are not contained within the client config tags. An exported config from Azure portal has:

    <clientconfig
    i:nil="true" />

    The screenshot adds the dnsserver tags after the clientconfig (not within it). This client config lines above need to be removed and replaced with the the below. Using the screenshot as an example, the relevant section should have:
    <clientconfig>
    <dnsservers>
    <dnsserver>8.8.8.8</dnsserver>
    <dnsserver>168.63.129.16</dnsserver>
    </dnsservers>
    </clientconfig>

    0 comments No comments