DevOps 解决linux配置openvpn客户端不能push dns的问题

hooooooooha · June 04, 2020 · 11 hits

在 openvpn 的配置文件 **.conf 中添加下面两行

1
2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf

然后需要手动安装包:
sudo apt-get install openresolv
or
sudo apt-get install resolvconf

由于在 linux 下很多软件都可以修改 dns 配置文件(/etc/resolv.conf),为了避免冲突一般使用openresolvresolvconf来管理 dns 配置。但是若遇到两者都不能自动修改/etc/resolv.conf文件的问题,可以手动编辑/etc/openvpn/update-resolv-conf文件来实现修改 dns:

https://gist.github.com/zaaack/7ab3d00c688115c7ad80d44d2ffbd121

No Reply at the moment.
You need to Sign in before reply, if you don't have an account, please Sign up first.