Skip to content

Instantly share code, notes, and snippets.

@wen-long
Last active August 29, 2015 14:14
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wen-long/4cf7ae625fa97fb379ce to your computer and use it in GitHub Desktop.
Save wen-long/4cf7ae625fa97fb379ce to your computer and use it in GitHub Desktop.

基于东哥 Cisco IPsec/IKEv2 VPN 与 dnsmasq
VPN 直接下载 mac/ios 配置文件并导入即可一键连接,下面只讨论如何分流

####安装 dnsmasq 并配置

brew update && brew install dnsmasq

并按提示完成(此处略) 添加下文至 /usr/local/etc/dnsmasq.conf

strict-order
no-resolv
no-poll
listen-address=0.0.0.0
cache-size=32768
resolv-file=/usr/local/etc/resolv.dnsmasq.conf
server=/fltrp.com/175.190.255.100
server=/mathtag.com/175.190.255.100
server=/114lm.com/175.190.255.100
server=/shuangtv.net/175.190.255.100
server=/funxoo.com/175.190.255.100
server=/guijiang.net/175.190.255.100

长长的国内域名及 ISP 分配的 DNS 列表此处略

echo "8.8.8.8" > /usr/local/etc/resolv.dnsmasq.conf

####重启 dnsmasq 并刷新 DNS 缓存

sudo launchctl stop homebrew.mxcl.dnsmasq
sudo launchctl start homebrew.mxcl.dnsmasq
sudo killall -HUP mDNSResponder

yosimite 下刷新 DNS 缓存为

sudo discoveryutil mdnsflushcache

####设置 DNS 为 127.0.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment