OpenVPN DNS Not Resolving? Find the Cause and Fix It
In this article
OpenVPN DNS failures almost always come from three causes: the server is not pushing a DNS server to the client, the client is leaking queries to a DNS server outside the tunnel, or the pushed DNS server itself is unreachable. Identify which one you have, then apply the matching fix below.
Time 30 min · Steps 8 · Level Medium
How to Work Through the DNS Failure
- Confirm the tunnel is actually up. Ping the VPN gateway's internal IP (for example 10.8.0.1) to prove the tunnel carries traffic before blaming DNS.
- Test DNS inside the tunnel. Query a domain by IP, such as
nslookup example.com 10.8.0.1, so you know whether the pushed server answers. - Check what DNS the client is using. Run
nslookup example.comwith no server argument and see which server it falls back to. - Inspect the server's push directives. Look for
push "dhcp-option DNS"lines in the server config and confirm the client log shows them arriving. - Block DNS outside the tunnel. Add firewall rules so port 53 traffic only flows through the tunnel, or use a client script that forces the pushed resolver.
- Fix Windows client handling. OpenVPN's TAP adapter does not apply pushed DNS on Windows by itself; use the interactive service or a script that sets the adapter's DNS.
- Verify the resolver itself. From the server, query the pushed DNS server directly to check it is running and reachable from the VPN subnet.
- Re-test and confirm. Resolve a domain, then browse a site, to prove the fix holds for real traffic.
Which DNS Problem Do You Actually Have?
Start by separating "the tunnel is broken" from "the tunnel works but names do not resolve." Ping the VPN's internal gateway IP, typically 10.8.0.1 on a default OpenVPN server setup. If that ping succeeds, the tunnel is fine and the problem is DNS only. If it fails, fix connectivity first, because no DNS change will help.
Next, test DNS by IP. On Windows run nslookup example.com 10.8.0.1; on Linux or macOS dig @10.8.0.1 example.com works the same way. Substitute whatever DNS server your setup pushes. If a query sent straight to that server answers, the resolver is healthy and your client is simply not using it. If the query times out, the resolver is the problem. That single test splits the three causes cleanly.
The Server Is Not Pushing DNS
This is the most common cause: the client connects, gets an IP, but never receives a DNS server, so it keeps using whatever it used before and that path may not work through the tunnel.
How to confirm: check the server config (often /etc/openvpn/server.conf on Linux servers) for lines like push "dhcp-option DNS 10.8.0.1". Then read the client connection log; pushed options appear there as they arrive. If the log shows no dhcp-option lines, nothing is being pushed.
Fix steps:
- Open the server config and add one line per resolver, for example
push "dhcp-option DNS 10.8.0.1"and, if you want a fallback, a second line with another address. - Restart the OpenVPN service on the server (on many Linux systems,
systemctl restart openvpn; exact service names vary). - Reconnect the client and watch the log for the dhcp-option lines.
- Run
nslookup example.comwith no server argument and confirm it now reports the pushed address.
How to tell it worked: the plain nslookup shows the VPN's DNS server as the default resolver, and a site that failed before now loads.
DNS Queries Are Leaking Outside the Tunnel
The second cause: the client does receive the pushed DNS server, but the operating system keeps sending queries to an older resolver, such as the one from the local Wi-Fi network. That resolver may refuse or mangle queries that arrive from a VPN address, which shows up as intermittent or total resolution failure.
How to confirm: run nslookup example.com and look at the "Server:" line. If it names an address other than the pushed one, queries are bypassing the VPN resolver. On Windows, ipconfig /all shows every adapter's DNS servers side by side.
Fix steps:
- On the server, add
push "block-outside-dns"if your clients are Windows; this makes the client block DNS queries that do not go to the pushed server. Support for this option depends on client version, so verify it in the client log. - On Linux clients, pushed dhcp-options are ignored by default. Run OpenVPN with a script that applies them, for example through the
upanddowndirectives that rewrite/etc/resolv.confor configure systemd-resolved. - Alternatively, add a firewall rule on the client allowing port 53 (UDP and TCP) only over the tunnel interface, so leaked queries simply fail rather than half-work.
- Reconnect and re-run the plain nslookup to confirm the resolver is now the pushed one.
Windows Clients Ignore Pushed DNS
Windows deserves its own note because of a long-standing quirk: OpenVPN's TAP adapter does not automatically register pushed DNS servers with Windows networking, so even a correct server push appears to do nothing.
How to confirm: the client log shows the dhcp-option DNS lines arriving, yet ipconfig /all still lists a different DNS server on the TAP adapter.
Fix steps:
- Run the OpenVPN GUI as administrator, or better, install and use the OpenVPN interactive service so scripts can change adapter settings without manual elevation.
- In the client config, add
block-outside-dns(client-side) so the client applies the pushed DNS and blocks other resolvers while connected. - Reconnect, then check
ipconfig /all: the TAP adapter should now show the pushed DNS address.
Menu names and option support differ slightly between versions, so treat the log as the source of truth for what actually applied.
The Pushed DNS Server Is Unreachable
The least common but trickiest cause: everything is configured correctly, but the resolver itself is down, or the VPN server's firewall blocks port 53 from the client subnet.
How to confirm: from a client, run nslookup example.com 10.8.0.1 (using your pushed address). A timeout points at the resolver or the firewall. Then run the same query on the VPN server itself; if it works locally but not from the client, a firewall rule between the two is the culprit.
Fix steps:
- On the server, check the resolver service is running (for dnsmasq or unbound, check the service status with your system's service manager).
- Allow UDP and TCP port 53 from the VPN subnet (for example 10.8.0.0/24) in the server firewall.
- If the resolver only listens on 127.0.0.1, change it to also listen on the VPN interface address, then restart it.
- Re-run the direct nslookup from the client; it should answer within a second or two.
What If Only Some Domains Fail?
Partial failures usually mean split DNS: the pushed resolver handles internal names but not public ones, or the reverse. Check whether the failing names are internal (company hostnames) or public (websites). If internal names fail, the pushed resolver needs a forwarding rule or a zone for the internal domain. If public names fail, the resolver's upstream forwarders are broken; test them from the server with a direct query to the upstream address. Also flush the client cache after any change, with ipconfig /flushdns on Windows, so old negative answers do not mask a fix.
Official source: OpenVPN Community