Phase 03 · Harden and verify

DNS Leak Protection: Configure VPN DNS on Windows, Mac, Linux

Set DNS inside a WireGuard or OpenVPN tunnel, handle the resolver on each operating system including systemd-resolved, and confirm which server answers.

This guide
13

steps, roughly in order.

01

Understand where DNS is actually decided

Your VPN config can request a resolver, but the operating system decides which one gets used. Windows ranks interfaces by metric. macOS keeps an ordered list of resolvers per service. Linux answers through whatever owns /etc/resolv.conf, which is often systemd-resolved rather than the file itself. Configuring the tunnel is half the job, and the resolver stack is the other half. This guide covers the configuration side, so read the companion post for what a leak is and how to test for one.

What a DNS leak is and how to test for one

02

Set DNS inside a WireGuard tunnel

A PulseVPN WireGuard config already carries a DNS line in the Interface section, set to 1.1.1.1, so there is usually nothing to add. On Windows and macOS the client applies it directly. On Linux, wg-quick hands the value to resolvconf or to systemd-resolved, so the value only takes effect if one of those is installed and running. Without either, the DNS line is accepted and quietly ignored.

WireGuard advanced tweaks

03

Set DNS inside an OpenVPN tunnel

OpenVPN receives resolvers from the server as dhcp-option DNS entries, which the client pulls by default. Windows and macOS clients apply them without help. Linux does not, because the openvpn process has no way to rewrite the system resolver on its own. It needs an up and down script such as update-resolv-conf or update-systemd-resolved, wired in with script-security 2, the level that permits user-defined scripts. Check which of those helpers your own distribution packages before adding either line.

04

Confirm the resolver on Windows

Run ipconfig /all and read the DNS servers listed against each adapter, not only the VPN one. In PowerShell, Get-DnsClientServerAddress gives the same list in a form that is easier to scan. If your physical adapter still lists your router or your ISP, Windows can and will use it whenever the tunnel adapter answers slowly. Lower the tunnel adapter metric or remove the override rather than hoping the ordering holds.

05

Stop other interfaces answering on Windows

Windows sends lookups out of several interfaces at once and takes the first reply, which defeats resolver ordering entirely. The OpenVPN directive block-outside-dns blocks queries that are not going through the tunnel and is the direct answer to this behaviour. It is a Windows-only directive and has no meaning on macOS or Linux. PulseVPN profiles do not include it, so add the line to the profile yourself rather than trying to solve the problem with adapter settings alone. Then run ipconfig /all and confirm the OpenVPN adapter lists a resolver, because the directive blocks rather than redirects.

block-outside-dns and other OpenVPN flags

06

Confirm the resolver on macOS

Run scutil --dns and read the resolver list in order. The first resolver block is the one macOS prefers, and the tunnel resolver needs to be there rather than further down. Network settings can also carry a manually entered DNS server on the Wi-Fi service, which survives every VPN connection and overrides the pushed value. Check that service for leftover entries before changing anything else.

07

Handle systemd-resolved on Linux

Run resolvectl status and read the per-link entries rather than the global one. Each link has its own DNS servers and its own search domains. Set the tunnel resolver with resolvectl dns wg0 followed by the address. Then set resolvectl domain wg0 to the routing domain written as a tilde followed by a dot, which tells systemd-resolved to send every lookup down that link. Without that routing domain, only matching domains use the tunnel and everything else goes to your old resolver.

08

Handle Linux without systemd-resolved

Check what /etc/resolv.conf actually is before editing it. If it is a symlink into /run, something owns it and your edit will be overwritten on the next reconnect. If it is a real file, the resolver entries in it are authoritative and the tunnel needs to rewrite them through resolvconf or an OpenVPN up script. Editing a managed resolv.conf by hand is the most common reason a fix works once and never again.

09

Watch what NetworkManager does with an imported profile

A profile imported into NetworkManager gets its DNS handled by NetworkManager rather than by the VPN client. That is usually fine, and it changes where you go to fix things. Set the connection to use the VPN DNS only, then set ipv4.dns-priority and ipv6.dns-priority so the tunnel resolver outranks the physical connection. A lower number wins in that setting, which is the opposite of what most people expect.

Importing a config file

10

Remove the overrides you forgot about

Browsers resolve names themselves when secure DNS or DNS over HTTPS is switched on, which bypasses the system resolver and therefore the tunnel. Security suites and ad-blocking tools install their own resolvers in the same way. A router with a hardcoded resolver affects every device on the network. Disable each one deliberately, one at a time, so you know which change fixed the behaviour.

11

Deal with IPv6 separately

A tunnel that carries only IPv4 leaves IPv6 name resolution to whatever the local network offers. Either give the tunnel an IPv6 resolver and an IPv6 range in AllowedIPs, or disable IPv6 on the interface while the tunnel is up. Choosing neither leaves the machine with a working IPv6 resolver outside the tunnel. Decide which of the two you want, and apply it on every interface rather than only the active one.

12

Pair the configuration with a kill switch

Correct DNS configuration still leaves the reconnect window, where the tunnel is down and the resolver stack falls back to the local network. A firewall-level kill switch closes that window because it blocks lookups along with everything else. This is the one place the two setups genuinely depend on each other. Configure DNS first, then add the kill switch, so you can tell which one changed the result.

Kill switch setup for Windows, macOS and Linux

13

If lookups still leave the tunnel

Re-import the config, since a partially applied profile can leave stale resolver entries behind. Try a second server, which rules out one endpoint pushing something unexpected. Reboot once, because resolver caches and interface metrics both survive a reconnect. If the behaviour holds after all three, send support the output of your resolver command along with your operating system and client.

Fix an OpenVPN DNS leakConnection troubleshooting

Next in Harden and verify
WireGuard: Advanced Tweaks

Client-only tips for DNS leak-proofing, MTU tuning, and split tunneling.

Still stuck?

The help center covers the FAQs, and support tickets are answered from the dashboard without asking who you are.

Where this fits
01

Get access

Create an anonymous account, pay in crypto, and produce your first credentials.

02

Connect a device

Import the tunnel on desktop, mobile, or a router with WireGuard or OpenVPN.