![Windows 7 不使用 VPN DNS 服务器](https://linux22.com/image/1406267/Windows%207%20%E4%B8%8D%E4%BD%BF%E7%94%A8%20VPN%20DNS%20%E6%9C%8D%E5%8A%A1%E5%99%A8.png)
我正在使用 OpenVPN 连接到我的公司 VPN。我的 VPN 网络是 192.168.32.x,它解析为使用 10.0.xx 的公司网络。我的家庭网络用户是 192.168.1.x。
当我连接时,Open VPN 会添加路由并安装主 DNS,这是应该发生的。我已使用 ipconfig /all 和 route print 验证了情况确实如此。
Ethernet adapter Local Area Connection 2:
Connection-specific DNS Suffix . : xxxxx.net <-I've xxx'd the actual domain
Description . . . . . . . . . . . : TAP-Windows Adapter V9
Physical Address. . . . . . . . . : 00-FF-35-83-90-6D
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::cc01:9ac9:695f:87e2%32(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.32.6(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.252
Lease Obtained. . . . . . . . . . : Wednesday, April 23, 2014 9:08:21 PM
Lease Expires . . . . . . . . . . : Thursday, April 23, 2015 9:08:35 PM
Default Gateway . . . . . . . . . :
DHCP Server . . . . . . . . . . . : 192.168.32.5
DHCPv6 IAID . . . . . . . . . . . : 453050165
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-E0-67-2F-A0-B3-CC-20-FC-87
DNS Servers . . . . . . . . . . . : xxx.x.xxx.xx <-I've xxx'd the actual public IP
Primary WINS Server . . . . . . . : 10.0.0.82
NetBIOS over Tcpip. . . . . . . . : Enabled
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . : lan
Description . . . . . . . . . . . : Atheros AR8151 PCI-E Gigabit Ethernet Con
troller (NDIS 6.20)
Physical Address. . . . . . . . . : A0-B3-CC-20-FC-87
DHCP Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Link-local IPv6 Address . . . . . : fe80::e86f:e3f8:585b:2be6%13(Preferred)
IPv4 Address. . . . . . . . . . . : 192.168.1.116(Preferred)
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Lease Obtained. . . . . . . . . . : Wednesday, April 23, 2014 9:08:20 PM
Lease Expires . . . . . . . . . . : Thursday, April 24, 2014 9:08:20 PM
Default Gateway . . . . . . . . . : 192.168.1.1
DHCP Server . . . . . . . . . . . : 192.168.1.1
DHCPv6 IAID . . . . . . . . . . . : 295744460
DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-1A-E0-67-2F-A0-B3-CC-20-FC-87
DNS Servers . . . . . . . . . . . : 192.168.1.1
NetBIOS over Tcpip. . . . . . . . : Enabled
这是我的路线打印:
C:\Users\Phil>route print
===========================================================================
Interface List
32...00 ff 35 83 90 6d ......TAP-Windows Adapter V9
17...c4 85 08 07 68 aa ......Microsoft Virtual WiFi Miniport Adapter #2
16...c4 85 08 07 68 aa ......Microsoft Virtual WiFi Miniport Adapter
15...c4 85 08 07 68 a9 ......Intel(R) Centrino(R) Advanced-N 6235
13...a0 b3 cc 20 fc 87 ......Atheros AR8151 PCI-E Gigabit Ethernet Controller (
NDIS 6.20)
1...........................Software Loopback Interface 1
29...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter
14...00 00 00 00 00 00 00 e0 Teredo Tunneling Pseudo-Interface
27...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #2
30...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #3
28...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #5
34...00 00 00 00 00 00 00 e0 Microsoft ISATAP Adapter #6
===========================================================================
IPv4 Route Table
===========================================================================
Active Routes:
Network Destination Netmask Gateway Interface Metric
0.0.0.0 0.0.0.0 192.168.1.1 192.168.1.116 10
10.0.0.0 255.255.255.0 192.168.32.5 192.168.32.6 30
127.0.0.0 255.0.0.0 On-link 127.0.0.1 306
127.0.0.1 255.255.255.255 On-link 127.0.0.1 306
127.255.255.255 255.255.255.255 On-link 127.0.0.1 306
192.168.1.0 255.255.255.0 On-link 192.168.1.116 266
192.168.1.116 255.255.255.255 On-link 192.168.1.116 266
192.168.1.255 255.255.255.255 On-link 192.168.1.116 266
192.168.32.1 255.255.255.255 192.168.32.5 192.168.32.6 30
192.168.32.4 255.255.255.252 On-link 192.168.32.6 286
192.168.32.6 255.255.255.255 On-link 192.168.32.6 286
192.168.32.7 255.255.255.255 On-link 192.168.32.6 286
224.0.0.0 240.0.0.0 On-link 127.0.0.1 306
224.0.0.0 240.0.0.0 On-link 192.168.1.116 266
224.0.0.0 240.0.0.0 On-link 192.168.32.6 286
255.255.255.255 255.255.255.255 On-link 127.0.0.1 306
255.255.255.255 255.255.255.255 On-link 192.168.1.116 266
255.255.255.255 255.255.255.255 On-link 192.168.32.6 286
===========================================================================
Persistent Routes:
None
IPv6 Route Table
===========================================================================
Active Routes:
...
Persistent Routes:
None
当我使用 nslookup (nslookup somehost.somedomain.com) 时,我能够将 VPN 上的主机名解析为正确的 VPN IP 地址。因此,这按预期工作。
当我 ping 同一主机名(ping somehost.somedomain.com)时,我收到错误:Ping 请求找不到主机 somehost.somedomain.com。请检查名称并重试。如果我尝试使用任何其他服务,主机名将无法解析。
使用 NetMon,当我 ping VPN 主机名时,它检查的唯一 DNS 服务器是我的家庭网络 DNS 服务器(即我的家庭路由器,192.168.1.1,运行 dd-wrt)。因此它完全忽略了 VPN dns 服务器。
我有点不知所措。这个配置对我来说已经工作了一段时间,直到大约 2 周前,并且仍然在其他客户端上运行良好,所以它只是我的机器或家庭网络的本地配置。我不确定那段时间除了我的无线路由器之外发生了什么变化。