AD SPACE AVAILABLE · BRAND PARTNERS WELCOME

Put 365 Wiki to work with your AI

Copy the prompt below, paste it into the AI you already use, then ask your question.

Download full Skill

Try it with the prompt first. If you use 365 Wiki often, install the full 365Wiki Skill so you do not have to paste it again. No regular AI? Gemini or Microsoft Copilot on the web will work.

365Wiki Skill

i365Finds Editorial is the independent research and editorial organization behind 365 Wiki. We follow changes in tools, products, services, entertainment, and digital life around the world, turning scattered and fast-moving information into clearly sourced, well-structured public content that is easier to understand and compare.
Indexed 90,207 Wiki articles

Split-Tunneling Without Leaks: Configuring Corporate WireGuard and OpenVPN for Remote Teams

Sergio García Encina · 365Finds Editorial

Remote network access frequently breaks on a quiet, humiliating edge case: an employee tries to print an invoice on their home Wi-Fi printer, only to find the printer missing; or an engineer opens an internal staging dashboard, unaware that their residential ISP just logged every private corporate hostname query.

Split-tunneling exists to prevent corporate bottlenecks. You want private infrastructure requests (internal Git repositories, private subnets, staging databases) routed securely through the VPN tunnel, while personal YouTube streams, video calls, and home office hardware remain on the local physical network. Yet at 365Finds, we repeatedly see teams treat split-tunneling as an IP routing checkbox while ignoring the DNS resolver subsystem.

IP routing dictates where packets travel once an IP address is known. DNS resolution dictates who learns what IP you are looking for in the first place. When these two systems fall out of sync, two immediate disasters occur: internal DNS requests leak directly to public ISPs and local routers, or local network discovery collapses entirely.

Fixing this requires configuring route boundaries and resolver priority together across WireGuard and OpenVPN.


Why Local Printers Disappear and Internal DNS Leaks

The friction between corporate privacy and local device accessibility boils down to three architectural mistakes:

1. Subnet Collisions Over Sacred Home Ranges

Almost every consumer Wi-Fi router on Earth hands out addresses from 192.168.0.0/24 or 192.168.1.0/24. When a network administrator carelessly includes 192.168.0.0/16 or blanket corporate CIDRs inside the VPN routing table, the operating system prioritizes the VPN route. The moment a client machine tries to talk to a local network printer at 192.168.1.45, the packets are sucked into the corporate tunnel and discarded.

2. Windows Smart Multi-Homed Name Resolution (SMHNR)

Windows 10 and 11 do not query DNS adapters sequentially by default. Through Smart Multi-Homed Name Resolution, Windows fires DNS queries simultaneously across all active network adapters (Wi-Fi, Ethernet, and virtual VPN interfaces). The adapter that answers first wins the race.

Because a home router or upstream ISP resolver responds in 2 to 5 milliseconds—usually returning NXDOMAIN for internal domains like auth.internal.corp—and the corporate DNS across the encrypted VPN takes 25 to 50 milliseconds, two failures happen at once:

3. The block-outside-dns Disaster in Split-Tunneling

OpenVPN features a well-known directive: block-outside-dns. It utilizes the Windows Filtering Platform (WFP) to drop DNS packets (UDP/TCP port 53) on all non-VPN adapters. While this is effective for full-tunnel VPNs to prevent leaks, enabling it on a split tunnel is disastrous. It completely blocks the machine from querying the local router for public internet domains or discovering local devices. The remote worker can reach internal hosts, but their general internet access and local printer communication die instantly.


Configuring Split-Tunneling and DNS in WireGuard

WireGuard is an exceptionally clean protocol, but its official desktop clients rely heavily on operating system routing tables rather than deep platform-specific DNS policy managers. Achieving leak-free split tunneling requires explicit IP boundaries and operating system DNS integration.

Step 1: Restrict AllowedIPs and Avoid Blanket Subnets

Never use AllowedIPs = 0.0.0.0/0, ::/0 on a split tunnel. Limit the tunnel strictly to your corporate VPC subnets and the exact IP of your internal DNS resolver.

[Interface]
PrivateKey = <Client_Private_Key>
Address = 10.200.0.45/32
DNS = 10.200.0.2, corp.internal

[Peer]
PublicKey = <Server_Public_Key>
Endpoint = vpn.company.com:51820
AllowedIPs = 10.200.0.2/32, 10.10.0.0/16, 172.20.0.0/14

Notice what is missing: 192.168.0.0/16 is completely excluded. The local subnet (192.168.1.0/24) stays bound to the physical Wi-Fi interface, keeping network printers and local NAS devices reachable.

Step 2: Enforce Domain-Scoped DNS Resolution

Simply listing DNS = 10.200.0.2 in WireGuard causes the client OS to direct all web lookups to the corporate resolver, congesting corporate DNS and slowing external browsing. Appending search domains (corp.internal) helps, but different operating systems handle this differently.

On Windows: Name Resolution Policy Table (NRPT)

To stop Windows SMHNR from leaking internal domain queries to local Wi-Fi adapters without blocking external DNS, register an NRPT rule inside WireGuard's configuration using PostUp and PostDown:

[Interface]
PrivateKey = <Client_Private_Key>
Address = 10.200.0.45/32

PostUp = powershell -ExecutionPolicy Bypass -Command "Add-DnsClientNrptRule -Namespace '.corp.internal' -NameServers '10.200.0.2' -DisplayName 'WireGuard-Split-DNS'"
PostDown = powershell -ExecutionPolicy Bypass -Command "Get-DnsClientNrptRule | Where-Object {$_.DisplayName -eq 'WireGuard-Split-DNS'} | Remove-DnsClientNrptRule -Force"

The NRPT instructs Windows: any query matching *.corp.internal must exclusively query 10.200.0.2 through the VPN. Every other query (e.g., public websites or local printer discovery) continues out the standard local interface.

On Linux: systemd-resolved Routing Domains

On modern Linux distributions, wg-quick interacts with systemd-resolved. To prevent queries for external sites from traversing the VPN while guaranteeing internal queries never hit the local router, configure a routing domain using the ~ prefix:

[Interface]
PrivateKey = <Client_Private_Key>
Address = 10.200.0.45/32
PostUp = resolvectl dns %i 10.200.0.2; resolvectl domain %i ~corp.internal; resolvectl default-route %i false
PostDown = resolvectl revert %i

The ~corp.internal directive specifies that corp.internal is a routing domain only, not an umbrella search domain for public traffic. Setting default-route false guarantees that public DNS traffic is never routed to the internal DNS server.

On macOS: Scoped Resolvers via /etc/resolver

macOS handles split DNS natively through its /etc/resolver/ directory. By creating a domain-specific resolver file, queries for that corporate namespace bypass standard Wi-Fi DNS:

sudo mkdir -p /etc/resolver
sudo tee /etc/resolver/corp.internal > /dev/null <<EOF
nameserver 10.200.0.2
EOF

Configuring Split-Tunneling and DNS in OpenVPN

In OpenVPN deployments, server-pushed directives determine client behavior. A single misplaced directive breaks local networking or triggers silent leaks.

Step 1: Server Configuration (server.conf)

Ensure your OpenVPN server does not force the default gateway. Push explicit CIDR routes and internal DNS configurations:

# Do NOT push "redirect-gateway def1"

# Push private corporate routes only
push "route 10.10.0.0 255.255.0.0"
push "route 172.20.0.0 255.252.0.0"

# Push internal DNS resolver and domain search suffix
push "dhcp-option DNS 10.200.0.2"
push "dhcp-option DOMAIN corp.internal"
push "dhcp-option DOMAIN-SEARCH corp.internal"

# CRITICAL: Do NOT push "block-outside-dns" in a split-tunnel setup!

If your server configuration previously contained push "block-outside-dns", remove it immediately. In split-tunnel setups, that directive drops local network DNS packets and severs access to home office peripherals.

Step 2: Client-Side Resolver Management

Windows Client Metric Priority

When OpenVPN creates its TAP or TUN adapter, Windows may assign it a high interface metric, allowing local Wi-Fi resolvers to respond faster during SMHNR parallel lookups. In your .ovpn profile, push an explicit route metric:

route-metric 50

Alternatively, corporate IT can push the same PowerShell NRPT rule via Microsoft Intune or Active Directory GPO:

Add-DnsClientNrptRule -Namespace ".corp.internal" -NameServers "10.200.0.2" -DisplayName "Corporate Split DNS"

Linux Client Integration

Standard Linux OpenVPN clients do not automatically update systemd-resolved without a script hook. Without this hook, /etc/resolv.conf either remains untouched (leaking all queries to the local router) or gets overwritten globally (routing all personal traffic through corporate DNS).

Install openvpn-systemd-resolved and add the execution hooks to your client profile:

script-security 2
setenv PATH /usr/bin:/usr/sbin:/bin:/sbin
up /usr/libexec/openvpn/update-systemd-resolved
down /usr/libexec/openvpn/update-systemd-resolved
down-pre
dhcp-option DOMAIN-ROUTE corp.internal

This ensures systemd-resolved attaches corp.internal strictly to the tun0 interface as a routing domain.


The Silent Leak: Browser DNS-over-HTTPS (DoH)

Even after hardening WireGuard, OpenVPN, NRPT tables, and systemd-resolved, remote engineers often discover their internal domains still appearing on external DNS services.

The culprit is usually the web browser. Modern versions of Google Chrome, Mozilla Firefox, Microsoft Edge, and Apple Safari (via iCloud Private Relay) enable DNS-over-HTTPS (DoH) by default. When DoH is active, the browser completely ignores the operating system's network stack, routing tables, and NRPT policies. It wraps DNS lookups inside HTTPS queries directed to Cloudflare (1.1.1.1) or Google (8.8.8.8).

When an employee navigates to https://gitlab.corp.internal:

  1. The browser bypasses local OS resolver hooks and queries Cloudflare over HTTPS port 443.
  2. Cloudflare returns NXDOMAIN because corp.internal does not exist on public roots.
  3. The internal service fails to load.
  4. Your private internal domain name is logged on third-party public resolvers.

Corporate Remediation

Teams must enforce centralized browser management policies via MDM (Intune, Jamf, or Group Policy):


Split-Tunneling Architecture Comparison

DimensionNaive Split-TunnelingHardened Domain-Scoped Split-TunnelingFull Tunneling
Routing ScopeSpecific IP routes onlySpecific IP routes only0.0.0.0/0, ::/0 (All traffic)
DNS ResolutionGlobal DNS or default OS resolverDomain-scoped (NRPT / routing domain ~)All DNS forced through VPN
Internal DNS Leak RiskHigh (SMHNR & local ISP leaks)Zero (Namespace bound to tunnel)Zero (All traffic encrypted)
Home Printer & LAN AccessOften broken by collisionsPreserved (Local subnet unmapped)Broken unless LAN bypass configured
Bandwidth & Latency ImpactLow on corporate egressLow on corporate egressHigh (All video and personal traffic routed)
Browser DoH HandlingUncontrolled (Silent leak to public DoH)Managed via enterprise MDM policyManaged via enterprise MDM policy

Verification: Auditing Your Configuration

Before rolling out split-tunnel profiles across remote engineering teams, verify DNS leak prevention and local reachability directly on client endpoints:

  1. Verify Interface Routing and Local Reachability: Ping the local router and printer directly while the tunnel is active:

    ping 192.168.1.1
    ping 192.168.1.45
    

    Both must reply with sub-millisecond local network latency.

  2. Verify Split-DNS Routing on Linux:

    resolvectl status tun0
    

    Confirm that Link 2 (tun0) shows your internal DNS under Current DNS Server and ~corp.internal under DNS Domain.

  3. Verify NRPT Binding on Windows:

    Get-DnsClientNrptPolicy -Effective
    

    Confirm that .corp.internal is mapped strictly to 10.200.0.2 and no wildcards (.) hijack global traffic.

  4. Audit for Outbound DNS Leakage: Run a packet capture on the physical Wi-Fi adapter while resolving an internal domain:

    # Linux / macOS
    sudo tcpdump -i wlan0 -n port 53
    
    # Windows PowerShell
    pktmon start --capture --pkt-size 0
    Resolve-DnsName gitlab.corp.internal
    pktmon stop
    

    If queries containing corp.internal appear on the physical wireless adapter, the namespace resolver is misconfigured. In a properly configured split tunnel, zero internal domain queries hit the local physical interface.


References