Posted: Fri Jun 04, 2021 20:27 Post subject: [SOLVED]How To Push DNS Server To OpenVPN Clients?
Hello,
I am having difficulty trying to figure out how to configure OpenVPN server on my DDWRT (r45632) to push the DNS server to the clients which connect to the server.
To explain, if you look at the attached diagram, I am connecting via TUN from a Windows 10 PC with OpenVPN GUI (2.5.0.21). When my laptop connects to the VPN sever, its public IP is the same as the VPN server (which is correct), but when I run dnsleaktest.com, my PC is using my local ISP provider DNS instead of the DNS from the ISP at the server location.
Does anyone know how to configure so that when the OpenVPN clients connect to the server, they use the DNS from the server location?
Thanks in advance!
Last edited by gil_happy on Fri Jun 04, 2021 20:50; edited 1 time in total
In the Primary Home(router2) which has the OpenVPN server config, in the Services then the VPN tab, in the 'Additional Config' section I added:
push "dhcp-option DNS 192.168.1.2" [from the pic, this is the IP of my VPN router]
push "dhcp-option DOMAIN home5" [under the Services, Sevices of the VPN router, Used Domain=LAN&WAN, LAN Domain=home5, then save and reboot router]
At this point, when I use my Windows 10 PC and open the OpenVPN client to connect to the OpenVPN server and run https://dnsleaktest.com/, the DNS is pushed to the client and it does work (thanks for this)!
The only thing that I might add is that when I run this DNS leak test when connected to the VPN server, 3 of the 6 returned DNS servers are from the remote end or OpenVPN server location (which is good), but 3 out of the 6 are the local DNS servers. From a service point of view everything is working, but the 3 out 6 local DNS servers 'could' cause a problem down the road.