![當 macOS Mojave 上的主要服務為 forticlientsslvpn 時,scutil 不會更改 resolv.conf](https://rvso.com/image/1604795/%E7%95%B6%20macOS%20Mojave%20%E4%B8%8A%E7%9A%84%E4%B8%BB%E8%A6%81%E6%9C%8D%E5%8B%99%E7%82%BA%20forticlientsslvpn%20%E6%99%82%EF%BC%8Cscutil%20%E4%B8%8D%E6%9C%83%E6%9B%B4%E6%94%B9%20resolv.conf.png)
我用的version 6.0.8_149
是forticlient
.在forticlient的配置中,你可以告訴他執行一個位於 的腳本on connect
。有趣的是,我可以(使用之前的版本 5)注入我的腳本,透過dnsutil
.
除了更新到版本 6 後,dnsutil
不再修改名稱伺服器
我透過以下方式手動測試sudo scutil
:
$sudo scutil
password: *****
> get State:/Network/Service/forticlientsslvpn/DNS
> d.show
<dictionary> {
ServerAddresses : <array> {
0 : xxx.xx.xxx.xx
1 : yyy.yy.yyy.y
2 : 127.0.0.1
}
}
> d.remove ServerAddresses
> d.add ServerAddresses * 127.0.0.1 xxx.xx.xxx.xx
> set State:/Network/Service/forticlientsslvpn/DNS
> quit
Still got:
$ cat /etc/resolv.conf
nameserver xxx.xx.xxx.xx
nameserver yyy.yy.yyy.y
nameserver 127.0.0.1
正如你所看到的, 根本resolv.conf
沒有改變。
有人有什麼想法嗎?
對此我預先表示感謝。