OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
network high common DISPUTE

Restore VPN split DNS broken by a global DNS= in resolved.conf

omarchyarchendeavouroscachyoslaptop
CORRECTED An auditor found the fix wrong or incomplete and rewrote it.
AUDIT NOTE

The diagnosis is right (a static global DNS= in resolved.conf does outrank per-link DNS pushed by a VPN) and the resolvectl dns/domain/revert split-DNS recipe is correct, including '~.' for default-route-all-queries. Same defect as the captive-portal record: omarchy dns Cloudflare/Google/Custom also writes ipv4.ignore-auto-dns yes + explicit ipv4.dns/ipv6.dns onto every wifi and ethernet profile (verified in bin/omarchy-dns set_connection_dns), and clearing only resolved.conf and 20-omarchy-dns.conf leaves those per-profile servers in place, so internal names still will not resolve.

The cause above was not rewritten and may still contain the error described. The fix below is the corrected version.
RISK

Overwriting /etc/systemd/resolved.conf discards any other Resolve settings you had (DNSSEC, MulticastDNS, custom FallbackDNS). Back it up first: sudo cp /etc/systemd/resolved.conf{,.bak}.

Symptom

After connecting a corporate VPN (FortiClient, SonicWall Connect Tunnel, OpenVPN, AnyConnect), internal hostnames do not resolve and internal services are unreachable, even though the tunnel is up and routes exist. Adding entries to /etc/hosts reaches those specific hosts, proving routing works and only DNS is broken. resolvectl status shows the VPN's nameservers missing from the Global section.

Cause

Omarchy writes an explicit DNS= (and FallbackDNS=) into /etc/systemd/resolved.conf. A statically configured global DNS= takes precedence over anything a VPN client pushes, and clients that simply replace the /etc/resolv.conf symlink with a static file are ignored entirely because resolv.conf points at systemd-resolved's stub (127.0.0.53), not at the real resolvers.

Fix


# global resolved override
sudo tee /etc/systemd/resolved.conf >/dev/null <<'EOF'
[Resolve]
DNSOverTLS=no
EOF

# global NetworkManager override
sudo rm -f /etc/NetworkManager/conf.d/20-omarchy-dns.conf

# per-profile DNS pins that omarchy-dns also set (this step is required)
while IFS=: read -r uuid type; do
  case "$type" in 802-11-wireless|802-3-ethernet)
    sudo nmcli connection modify "$uuid" \
      ipv4.ignore-auto-dns no ipv4.dns "" \
      ipv6.ignore-auto-dns no ipv6.dns "" ;;
  esac
done < <(nmcli -t -f UUID,TYPE connection show)

sudo systemctl restart systemd-resolved NetworkManager
resolvectl status        # Global should now have no DNS Servers

On Omarchy 4.x, omarchy dns DHCP does all three of the above in one command.

For a client that never registers its DNS with resolved, wire split DNS by hand once the tunnel is up:


sudo resolvectl dns tun0 10.0.0.53 10.0.0.54
sudo resolvectl domain tun0 '~corp.example.com' '~internal'
sudo resolvectl flush-caches
resolvectl status tun0

Use '~.' as the domain to send every lookup down the tunnel. sudo resolvectl revert tun0 undoes it.

Verify

resolvectl status tun0 lists the VPN nameservers and the ~corp.example.com routing domain. resolvectl query intranet.corp.example.com returns the internal address and reports it was resolved via tun0.

Sources

resolved-dns-override-breaks-vpn-split-dns