VPN 搞乱了 DNS 解析

use*_*114 5 dns vpn macos

将 Kerio VPN 客户端 (OS X Leopard) 连接到服务器后,互联网(~网页浏览)停止为客户端工作。

经过一番摸索,问题似乎出在 DNS 服务器上(即直接输入 IP 有效)。与 VPN 断开连接后,无效的 DNS 服务器消失scutil --dns,一切都恢复正常。

现在,我不明白为什么客户端上的 OS X 甚至会更改 DNS 设置——互联网应该通过不同的接口路由,通过默认网关,而不是通过 VPN。

问题:

  1. 连接VPN客户端通过什么机制改变“默认”DNS服务器?
  2. 如何阻止 VPN 客户端更改路由/DNS 规则?这些东西在哪里存储/修改?

VPN前:

$ scutil --dns
DNS configuration

resolver #1
  nameserver[0] : 10.66.77.1 # <---- default gateway = home router; all good
  order   : 200000

resolver #2
  domain : local
  options : mdns
  timeout : 2
  order   : 300000

...
Run Code Online (Sandbox Code Playgroud)

VPN连接:

$ scutil --dns
DNS configuration

resolver #1
  nameserver[0] : 192.168.1.1 # <--- rubbish
  nameserver[1] : 192.168.2.1
  order   : 200000

resolver #2
  domain : local
  options : mdns
  timeout : 2
  order   : 300000

...
Run Code Online (Sandbox Code Playgroud)

VPN 不会出现在$ networksetup -listallnetworkservices. 它也不会出现在系统偏好设置的“网络”对话框中。ifconfig报告为

kvnet0: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1400
inet 192.168.2.9 netmask 0xffffff00 broadcast 192.168.2.255
ether 44:45:53:54:4f:53
Run Code Online (Sandbox Code Playgroud)

编辑:进度 - 根据Kerio VPN 文档

The VPN server also assigns the client an address for the primary, and
optionally also secondary DNS server and DNS domain extension. This 
allows to specify remote hosts with their names.

The change of DNS configuration has such effect that all DNS queries 
from the client host are sent to a DNS server in a remote private 
network. Users usually do not even notice any change. Upon closing of
the VPN connection, the original DNS configuration will be recovered.
Run Code Online (Sandbox Code Playgroud)

他们是怎么做的,我如何阻止他们这样做(在不关闭 VPN 的情况下切换回 DNS)?

use*_*114 -1

通过完全重新安装(Lion OS 而不是 Leopard)“解决”。

我仍然不知道问题出在哪里,但愿一切安息......