Usually the VPN will inherit the DNS from the RRAS server's connection properties.
--please don't forget to upvote
and Accept as answer
if the reply is helpful--
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Dear professionals,
I just consiger automatic registration about VPN connection with static DNS name server address information by command line (e.g. PowerShell).
Add-VpnConnection -Name $vpnName -ServerAddress $serverAddress -RememberCredential ...
After successful registration with above command, I try to
Set-DnsClientServerAddress -InterfaceAlias $vpnName -ServerAddress SSS.TTT.UUU.VVV
However, an error has occured as "No MSFT_DNSClientServerAddress objects found".
Next, switch the VPN to online, and execute above command. Then DNS server addresses looks affected.
ipconfig /all
PPP Adapter ????:
DNS Servers....:SSS.TTT.UUU.VVV
But it's temporary. So after disconnected and re-connected the VPN connection, that I/F has DNS server address information supplied by DHCP protocol.
ipconfig /all
PPP Adapter ????:
DNS Servers....:DDD.EEE.FFF.GGG <- (supplied by DHCP server)
Let me know how to register the static DNS addresses to VPN connection permanently.
I will appreciate your support.
Max
Usually the VPN will inherit the DNS from the RRAS server's connection properties.
--please don't forget to upvote
and Accept as answer
if the reply is helpful--
Hello Max,
You can use the registry key: HKLM\System\CurrentControlSet\Services\Tcpip\Linkage\Bind
This list the NIC GUIDs and their bindings and orders of preference for the adapter. This way you can establish the preference of your DNS setting over DHCP assignments.
Follow this steps:
Examine the Bind registry key
Connect to your VPN connection
Check the Bind key again and copy the GUID that was added to the top of the list
Paste the GUID entry at the bottom of the list 20 times
Export the key and clean up the exported file to only include the bind key
Hope this helps in your query,
Best regards,