0
dig domain.com +short

returns public ip

dig @172.16.0.1 domain.com +short

returns server dns routed ip

I want to use the dns routed IP by default. Changing client adapter settings to use 172.16.0.1 as the default DNS server achieves the desired result but I want the new route to be selected by default using openvpn.

Server:

ifconfig-push 172.16.3.4 255.255.252.0
push "route 172.16.0.0 255.255.252.0 172.16.3.4"    
push "dhcp-option DNS 172.16.0.1"
push "dhcp-option DOMAIN domain.com"

client:

client
dev tun
proto tcp
remote a.a.a.a 80
resolv-retry infinite
nobind
dhcp-renew
register-dns
allow-pull-fqdn
script-security 2
persist-key
persist-tun

route-method exe
route-delay 5
New contributor
Luke is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Luke is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.