通过VPN访问的主机的
在Windows 10主机上,对只有VPN可访问的DNS服务器才知道的主机的DNS查询无法解决。DNS查询被发送到本地DNS服务器(192.168.1.1),后者不返回DNS答案。DNS查询不会发送到VPN可访问的DNS服务器(10.0.1.1).
Powershell Get-DnsClientServerAddress显示:
PS> Get-DnsClientServerAddress
InterfaceAlias Interface Address ServerAddresses
Index Family
-------------- --------- ------- ---------------
Ethernet 10 IPv4 {192.168.1.1}
Ethernet 10 IPv6 {}
VPN 20 IPv4 {10.0.1.1}
VPN 20 IPv6 {}单击VPN DNS服务器成功(ping 10.0.1.1)。解析google.com的DNS名称成功(Resolve-DnsName google.com)。但是,解析VPN访问的主机server.corp.com的DNS名称失败.
PS> Resolve-DNSName server.corp.com
PS>How我是否可以强制DNS查询使用VPN访问的DNS服务器(10.0.1.1**?** )
发布于 2021-07-09 20:30:31
VPN接口的InterfaceMetric更改为比本地Ethernet接口值低(更重要)。使用Get-NetIPInterface,接口度量如下
PS> Get-NetIPInterface ifIndex InterfaceAlias AddressFamily NlMtu(Bytes) InterfaceMetric Dhcp ConnectionState PolicyStore ------- -------------- ------------- ------------ --------------- ---- --------------- ----------- 10 Ethernet IPv4 1500 4000 Enabled Connected ActiveStore 20 VPN IPv4 1400 35 Disabled Connected ActiveStore
使用 Set-NetIPInterface I更改 VPN interface属性 InterfaceMetric to 15 <#>AddressFamily IPv4 (需要管理员权限)
PS> Set-NetIPInterface -InterfaceIndex 20 -InterfaceMetric 15
现在,对VPN访问的DNS服务器已知主机的DNS查询将成功.
PS> Resolve-DNSName server.corp.com Name Type TTL Section IPAddress ---- ---- --- ------- --------- server.corp.com A 130 Answer 10.0.1.2https://serverfault.com/questions/1069162
复制相似问题