Problem Pushing DNS Server Info To OpenVPN Clients

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 142

PostPosted: Tue Jun 10, 2025 17:30    Post subject: Problem Pushing DNS Server Info To OpenVPN Clients Reply with quote
Hello,

I have recently configured an OpenVPN server (tun) on a Netgear R6700 [DD-WRT v3.0-r61648 std (06/05/25)] using 'egc' DDWRT OpenVPN Server Setup guide v34.pdf guide and it works great!

The problem that I'm having is pushing the DNS info from the OpenVPN server ISP to the Android clients that connect (see attached drawing). When I go to page 20 of the guide, I can't seem to get this working. Basically I want the Android client to the server to have the same DNS information as a local client that is connected to the cable modem / router. I believe the WAN interface on the Cable Modem obtains all it's info via DHCP including DNS.

I have tried the following:
- I added [push "redirect-gateway def1"] to Additional config and it did not work
- I tried adding both [push "route 0.0.0.0 128.0.0.0 vpn_gateway"] & [push "route 128.0.0.0 128.0.0.0 vpn_gateway"] to Additional config and it did not work.

Any suggestions?

Thanks in advance



DDWRT DNS Client Push.jpg
 Description:
 Filesize:  71.5 KB
 Viewed:  33110 Time(s)

DDWRT DNS Client Push.jpg


Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13880
Location: Netherlands

PostPosted: Wed Jun 11, 2025 6:41    Post subject: Reply with quote
You are pushing default routes which is not necessary as there is a GUI option for that (Push Client route).

The same paragraph on page 20 has instructions how to push DNS server(s) to the client.

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 142

PostPosted: Wed Jun 11, 2025 15:12    Post subject: Reply with quote
Hi, thanks for this... a couple of things:

- "Push Client Route: Default Gateway" in Advanced Options is enabled.

Then I see the following in your guide:

If you want to resolve DNS names over the VPN you will need to add the below lines to "Additional Configuration."
If you want to use a public DNS server (e.g. Google's ):
push "dhcp-option DNS 8.8.8.8"

- I don't want to set a specific public DNS server, so this is not the option

I assume this is the section you are referring to about pushing the DNS server settings from the OpenVPN server which is using the DNS from the ISP:

If you want to use your own router/OpenVPN server (my servers Lan Domain is named "home5"):
push "dhcp-option DNS 192.168.5.1"
push "dhcp-option DOMAIN home5"

- in my case, I hardcoded my OpenVPN router to 192.168.1.2 since the ISP router / gateway is 192.168.1.1
- then under 'Setup', 'Basic Setup' under Optional Settings, I set the 'Hostname' = home5

So based on this, I added the following to 'Services', 'VPN', then Additional Config and when I connect to the VPN, the DNS is not getting pushed.

push "dhcp-option DNS 192.168.1.2"
push "dhcp-option DOMAIN home5"
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13880
Location: Netherlands

PostPosted: Wed Jun 11, 2025 15:42    Post subject: Reply with quote
How do you know the DNS server is not pushed?

Even if it is pushed, it is up to the client to deal with the pushed DNs servers.

For my Android phone and tablet I use Arne Schwabs OpenVPN client for Android with that you can see in the log that a DNS server is pushed, my OpenVPN server on 192.168.6.1 is pushed to my Android client and is working, I have local name resolution.

You can push any DNS server you want, but of course that DNS server has to listen to requests from the OpenVPN subnet/interface.

Your OpenVPN server normally runs on a router in gateway mode with DNSMasq running on the router and if so you push the routers address as DNS server as that is where DNSMasq is listening.

DNSMasq on DDWRT should listen automatically on the tun interface.

Of course if your setup is different or you have another DNS server then DNSMasq on the router, then you have to adapt accordingly

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
gil_happy
DD-WRT User


Joined: 24 Sep 2009
Posts: 142

PostPosted: Wed Jun 11, 2025 17:50    Post subject: Reply with quote
Hi, thanks for this..... in terms of the DNS client not being pushed, I am using dnsleaktest.com and could see that once the Android client connected to the VPN server, the DNS was from my cell phone provider (vs the ISP where the OpenVPN server was connected to).

Yep, I use Arne Schwabs OpenVPN as well. However, I never did notice the DNS settings in the log - in fact I could see 'home5' in the log.

I figured out what the problem was. Your guide references 192.168.5.1 and thankfully you mentioned 192.168.6.1 in this email, so I could see what the problem was. I had push "dhcp-option DNS 192.168.1.2", but needed to change to push "dhcp-option DNS 192.168.1.1"


*** That being said, I see the DNS servers are now being pushed to the client. Thanks for helping me out 👍
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 13880
Location: Netherlands

PostPosted: Wed Jun 11, 2025 18:34    Post subject: Reply with quote
👍
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum