Change the InterfaceMetric
for the VPN
interface to be lower in value (more important) than the local Ethernet
interface.
Using Get-NetIPInterface
, the interface metrics were
PS> Get-NetIPInterface
ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore
------- -------------- ------------- ------------ --------------- ---- --------------- -----------
10 Ethernet IPv6 1500 35 Enabled Connected ActiveStore
10 Ethernet IPv4 1500 4000 Enabled Connected ActiveStore
20 VPN IPv4 1400 35 Disabled Connected ActiveStore
(yes, it is odd that the Ethernet
interface has AddressFamily IPv4
high integer value 4000
for InterfaceMetric
, has AddressFamily IPv6
low integer value 35
for InterfaceMetric
yet no IPv6 Address is assigned to the interface)
Using Set-NetIPInterface
I changed the VPN
interface property InterfaceMetric
to lower integer value 15
for AddressFamily IPv4
(requires Administrator permissions)
PS> Set-NetIPInterface -InterfaceIndex 20 -InterfaceMetric 15
Now the DNS queries for hosts known to the VPN-accessible DNS Server will succeed.
PS> Resolve-DNSName server.corp.com
Name Type TTL Section IPAddress
---- ---- --- ------- ---------
server.corp.com A 130 Answer 10.0.1.2