Fix wg-quick failing or silently not applying DNS
The premise holds and the symptom is right down to the line number, but the cause mis-states the invocation, the fix has a partial-upgrade hazard, and the danger names the wrong conflict and omits a DNS leak that Omarchy makes certain. Both cited sources resolve (200) and both support what they are cited for: wg-quick.8 documents that DNS = runs resolvconf -a tun.INTERFACE -m 0 -x on up and resolvconf -d tun.INTERFACE on down, and offers PostUp/PostDown as the alternative, explicitly allowing each to be given more than once. Neither is removed. Confirmed on this machine: pacman -Qo /usr/bin/resolvconf reports no owner, the file does not exist, and neither openresolv nor systemd-resolvconf is installed, so the record's whole premise is true on Omarchy 4 and not only on plain Arch. Also confirmed live: /etc/resolv.conf is a symlink to ../run/systemd/resolve/stub-resolv.conf, systemd-resolved is enabled and active, and /etc/systemd/resolved.conf.d/10-disable-multicast.conf from omarchy-settings 4.0.2-1 sets LLMNR=no and MulticastDNS=no, so the resolved destination the fix targets is already in place. I read the wireguard-tools source rather than trusting the man page and found two things. cmd() at line 30 runs "$@" at line 32, which is why line 32: resolvconf: command not found is exactly right, so I kept the symptom untouched. And the tun. prefix is conditional: resolvconf_iface_prefix at line 145 returns nothing unless /etc/resolvconf/interface-order exists and resolvconf is not a symlink, which is openresolv's shape, so under systemd-resolvconf the registered interface is the bare wg0. The record's own resolvectl status wg0 verify step is correct because of behaviour the cause gets wrong. unset_dns at line 165 also passes -f, which the man page omits. On the Omarchy override the operator asked about: it does not intercept here. omarchy-dns writes a NetworkManager [global-dns-domain-*] block and a global DNS= in /etc/systemd/resolved.conf, and NetworkManager.conf(5) confirms such a block overrides active connections, but wg-quick never goes through NetworkManager. resolvectl(1) says the shim maps -x to the route-only domain ~., and systemd-resolved.service(8) routes to the best matching routing domain, so the DNS = branch beats Cloudflare for every name. The leak is in the other branch: systemd.network(5) DNSDefaultRoute= defaults to automatic, meaning a link with DNS and no routing domain takes unmatched queries, so a user who copies resolvectl dns %i without resolvectl domain %i fans every query out to the tunnel and Cloudflare in parallel with first-answer-wins. Three fix defects. systemd-resolvconf depends on an exact systemd=<version>, verified both locally (Depends On: systemd=261.2 against installed systemd 261.2-1) and from archlinux.org, which now serves 261.3-1 depending on systemd=261.3, so a bare pacman -S can drag systemd up alone. The instinctive repair is -Syu, which Omarchy blocks: I read /usr/bin/omarchy-update-pacman-guard and it aborts only when a command line carries both a sync and a sysupgrade flag, so plain -S passes and -Syu <pkg> does not. The danger is wrong on the conflict: pacman -Si systemd-resolvconf and the archlinux.org JSON both give Conflicts With: resolvconf and Provides: openresolv resolvconf, so it provides openresolv rather than conflicting with it by name, and pacman -Qi openresolv is the wrong check where pacman -Qo /usr/bin/resolvconf is the right one. The Arch wiki adds that systemd-resolvconf only works while systemd-resolved.service is running. NOT exercised: wireguard-tools is not installed here (pacman -Q wireguard-tools fails), so no tunnel was brought up, no package was installed, nothing was reverted, and resolv.conf was not touched. The routing and leak behaviour is derived from the man pages plus the live resolvectl status/domain output, not from a running wg0. Severity stays medium: the loud branch fails closed and nothing is destroyed.
On Omarchy 4 the real risk is a DNS leak rather than a loud failure. omarchy-dns always writes global servers into /etc/systemd/resolved.conf, Cloudflare's 1.1.1.1 and 1.0.0.1 on a stock install. If wg0 ends up with DNS servers and no routing domain, which is what happens if you take the resolvectl dns %i line without the resolvectl domain %i line, systemd-resolved treats the link as a default route and sends every unmatched query to the tunnel and to Cloudflare in parallel, returning whichever answers first. Internal names then leave the tunnel in clear text, and a Cloudflare NXDOMAIN can beat the tunnel's real answer. Check with resolvectl domain once the tunnel is up.
systemd-resolvconf conflicts with the virtual resolvconf provider and itself provides openresolv, so pacman offers to replace whatever provider is installed. Check what that is with pacman -Qo /usr/bin/resolvconf before confirming. Do not install openresolv here instead: it manages /etc/resolv.conf itself, which on Omarchy is a symlink into systemd-resolved's runtime directory. systemd-resolvconf also only works while systemd-resolved.service is running, so do not install it on a machine that has resolved disabled.
Symptom
sudo wg-quick up wg0 fails with:
/usr/bin/wg-quick: line 32: resolvconf: command not found
or it comes up but internal names never resolve. The tunnel carries traffic to IPs fine, but DNS = 10.0.0.53 in the config has no visible effect and resolvectl status wg0 lists no DNS servers.
Cause
wg-quick's DNS = key is implemented entirely through resolvconf(8). Arch ships no resolvconf binary by default, and systemd-resolved's implementation is the separate systemd-resolvconf package, which installs /usr/bin/resolvconf as a symlink to resolvectl. Confirmed on an omarchy 4.0.2-1 machine: pacman -Qo /usr/bin/resolvconf reports no owner and the file is absent.
Two details of the invocation matter and they come from the wireguard-tools source, not the man page:
# src/wg-quick/linux.bash
30 cmd() {
31 echo "[#] $*" >&2
32 "$@"
...
145 resolvconf_iface_prefix() {
146 [[ -f /etc/resolvconf/interface-order && ! -L $(type -P resolvconf) ]] || return 0
...
159 } | cmd resolvconf -a "$(resolvconf_iface_prefix)$INTERFACE" -m 0 -x
165 cmd resolvconf -d "$(resolvconf_iface_prefix)$INTERFACE" -f
The missing binary is reported at line 32, where cmd runs its arguments. And the tun. prefix the man page shows is conditional on openresolv's /etc/resolvconf/interface-order and on resolvconf not being a symlink, so with systemd-resolvconf the interface registered is the bare wg0. That is why resolvectl status wg0 is the right place to look.
On Omarchy 4 the resolved side is already in place. /etc/resolv.conf is a symlink to ../run/systemd/resolve/stub-resolv.conf and systemd-resolved is enabled and active, both confirmed on the workstation. Omarchy's own DNS override is a red herring here and worth ruling out early: omarchy-dns puts Cloudflare in a NetworkManager [global-dns-domain-*] block at /etc/NetworkManager/conf.d/20-omarchy-dns.conf and in a global DNS= line in /etc/systemd/resolved.conf, and NetworkManager.conf(5) confirms such a block overrides the servers of active connections, but wg-quick never goes through NetworkManager. resolvectl(1) maps the shim's -x to the route-only domain ~., and systemd-resolved.service(8) sends a query to the servers of the best matching routing domain, so once the shim is installed the tunnel's resolvers beat the global Cloudflare ones for every name.
Fix
Install the resolvconf shim that feeds systemd-resolved. systemd-resolvconf depends on an exact systemd=<version>, so installing it on its own can drag systemd up by itself, which is a partial upgrade. Bring the system current first. On Omarchy this also fetches the pacman sync databases, which a fresh offline install does not have:
omarchy update
sudo pacman -S --needed systemd-resolvconf
systemctl is-enabled systemd-resolved # already enabled on a stock Omarchy 4
sudo wg-quick down wg0 || true
sudo wg-quick up wg0
Do not write that as sudo pacman -Syu systemd-resolvconf. Omarchy's guard at /usr/bin/omarchy-update-pacman-guard aborts any pacman command line carrying both a sync and a sysupgrade flag. A plain -S is not blocked.
Or skip resolvconf entirely and drive resolved from the config. wg-quick.8 allows each hook key more than once, so keep them on separate lines:
# /etc/wireguard/wg0.conf
[Interface]
PrivateKey = <key>
Address = 10.0.0.2/24
# DNS = 10.0.0.53 <-- remove this
PostUp = resolvectl dns %i 10.0.0.53
PostUp = resolvectl domain %i '~corp.example.com'
PreDown = resolvectl revert %i
[Peer]
PublicKey = <peer-key>
Endpoint = vpn.example.com:51820
AllowedIPs = 10.0.0.0/24
Keep the resolvectl domain line. Without it the link has DNS servers and no routing domain, which leaks queries to Omarchy's global resolvers. Use resolvectl domain %i '~.' instead if every lookup should go down the tunnel.
Verify
resolvectl status wg0 lists the tunnel's DNS server, and resolvectl domain shows ~. on wg0 after the DNS = path or the configured routing domain after the PostUp path. resolvectl query intranet.corp.example.com resolves and reports it was acquired via wg0. resolvectl status wg0 lists no DNS servers after sudo wg-quick down wg0.
Sources
- https://man.archlinux.org/man/wg-quick.8
- https://man.archlinux.org/man/systemd-resolved.service.8
- https://man.archlinux.org/man/resolvectl.1
- https://man.archlinux.org/man/NetworkManager.conf.5
- https://git.zx2c4.com/wireguard-tools/plain/src/wg-quick/linux.bash
- https://wiki.archlinux.org/title/WireGuard
- https://wiki.archlinux.org/title/Systemd-resolved
- https://archlinux.org/packages/core/x86_64/systemd-resolvconf/