Windows 10 vpn change the dns settings

internal-dnsrrasvpnwindows 10

My Windows 10 VPN IPv4 Properties button does not work. Others have found this too. There are powershell workarounds for changing default gateway options, e.g.

Set-VpnConnection -Name "VPN-NETWORK-NAME-HERE" -SplitTunneling $True

What I need, is to add the corporate DNS servers at the server end to my resolvers when my client is connected via the VPN.

Is there a way to either,

  1. Make the button work? – it did in Windows 7 before the upgrade.

OR

  1. A powershell or registry workaround to add the DNS servers?

help SetVpnConnection shows this:

PS C:\Users\Me> help set-vpnconnection

NAME
    Set-VpnConnection

SYNTAX
    Set-VpnConnection [-Name] <string> [[-ServerAddress] <string>] [[-TunnelType] <string> {Pptp | L2tp | Sstp | Ikev2
    | Automatic}] [[-EncryptionLevel] <string> {NoEncryption | Optional | Required | Maximum | Custom}]
    [[-AuthenticationMethod] <string[]> {Pap | Chap | MSChapv2 | Eap | MachineCertificate}] [[-SplitTunneling] <bool>]
    [[-AllUserConnection]] [[-L2tpPsk] <string>] [[-RememberCredential] <bool>] [[-UseWinlogonCredential] <bool>]
    [[-EapConfigXmlStream] <xml>] [-PassThru] [-Force] [-MachineCertificateEKUFilter <string[]>]
    [-MachineCertificateIssuerFilter <X509Certificate2>] [-ServerList <CimInstance#VpnServerAddress[]>]
    [-IdleDisconnectSeconds <uint32>] [-DnsSuffix <string>] [-CimSession <CimSession[]>] [-ThrottleLimit <int>]
    [-AsJob] [-WhatIf] [-Confirm]  [<CommonParameters>]

   Set-VpnConnection [-Name] <string> [[-ServerAddress] <string>] [[-ThirdPartyVpn]] [[-SplitTunneling] <bool>]
   [[-RememberCredential] <bool>] [[-PlugInApplicationID] <string>] [-PassThru] [-Force] [-ServerList
   <CimInstance#VpnServerAddress[]>] [-IdleDisconnectSeconds <uint32>] [-DnsSuffix <string>] [-CustomConfiguration
   <xml>] [-CimSession <CimSession[]>] [-ThrottleLimit <int>] [-AsJob] [-WhatIf] [-Confirm]  [<CommonParameters>]

Best Answer

Known bug

The do-nothing properties button on the ipv4 protocol is a ubiquitous problem in Windows 10. The problem has been widely reported long ago (before Windows 10 was even released) so do not expect a fix anytime soon. (Update: This is fixed in Win10TH2)

The only way I could manually set the DNS settings was to modify the rasphone.pbk file in C:\Users\<username>\AppData\Roaming\Microsoft\Network\Connections\Pbk. This is where the VPN settings are saved.

  1. Change IpPrioritizeRemote from 1 to 0.
  2. Change IpNameAssign from 1 to 2.
  3. Change IpDnsSuffix to the desired value.
  4. Change IpDnsAddress and IpDns2Address to the desired values.
Related Topic