Server Side:
1. Install dnsmasq
2. setup tcp tunnel of openvpn
3. iptables -t nat -I POSTROUTING -s 10.x.x.x/24 -j SNAT –to x.x.x.x
Client Side:
1. Add DNSMASQ_OPTS=”–clear-on-reload” to /etc/default/dnsmasq
2. setup tcp tunnel client of openvpn
3. Add 0 5 * * * lynx -source https://smarthosts.googlecode.com/svn/trunk/dnsmasq.conf | grep address | awk -F / {‘print “server=/”$2″/10.9.0.1″‘} > /etc/dnsmasq.d/smart_host_domain;; /etc/init.d/dnsmasq restart to crontab
4. Modify /etc/resolv.conf to use “nameserver 127.0.0.1” only