ubuntu版本: 12.04

安装

sudo apt-get install dnsmasq

配置

修改配置文件

listen-address=127.0.0.1,10.xxx.xxx.xxx
bind-interfaces

修改/etc/hosts

10.xxx.xxx.xxx      myself             dns.folowing.com
10.yyy.yyy.yyy      prd01              prd01.folowing.com
10.zzz.zzz.zzz      prd02              prd02.folowing.com
......

修改/etc/openvpn/server.conf

push "dhcp-option DNS 10.xxx.xxx.xxx"
push "dhcp-option DNS 8.8.8.8"

重启服务:sudo service dnsmasq stop

客户端配置

mkdir /etc/resolver
sudo vi /etc/resolver/folowing.com

添加以下行:

nameserver 10.xxx.xxx.xxx