[PR #3243] fix: apply KillSwitch DNS exceptions for WireGuard/AWG on macOS and Linux #3142

Open
opened 2026-10-15 04:07:46 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3243
Author: @dkostik
Created: 9/30/2026
Status: 🔄 Open

Base: dev ← Head: fix/killswitch-allowed-dns-wireguard


📝 Commits (1)

  • 84175cd fix: apply KillSwitch DNS exceptions for WireGuard/AWG on macOS and Linux

📊 Changes

2 files changed (+2 additions, -0 deletions)

View changed files

📝 client/platforms/linux/daemon/wireguardutilslinux.cpp (+1 -0)
📝 client/platforms/macos/daemon/wireguardutilsmacos.cpp (+1 -0)

📄 Description

Problem

With KillSwitch enabled and a WireGuard/AmneziaWG connection on macOS, DNS servers added under Settings → KillSwitch → DNS exceptions stay blocked. The address never shows up in the pf table:

sudo pfctl -a amn/310.blockDNS -t dnsaddr -T show

Adding it by hand (pfctl ... -T add <ip>) works only until the next (re)connect, because the table is replaced.

Cause

WireguardUtilsMacos::addInterface() (and WireguardUtilsLinux::addInterface()) build FirewallParams::dnsServers from m_primaryDnsServer and m_secondaryDnsServer only. InterfaceConfig::m_allowedDnsServers reaches the daemon (parsed in daemon.cpp), but these two platforms never use it. KillSwitch::enableKillSwitch (service path) and WindowsFirewall already include it.

Fix

Append config.m_allowedDnsServers to params.dnsServers in both daemons. This is a one-line change per platform.

Notes

  • #3144 contains the same change for macOS as part of a larger feature. This PR is a minimal standalone fix that also covers Linux, so it can land independently.
  • Not built locally. It was found and verified against v5.0.0 on macOS, where the exception is missing from dnsaddr after connect.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/amnezia-vpn/amnezia-client/pull/3243 **Author:** [@dkostik](https://github.com/dkostik) **Created:** 9/30/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/killswitch-allowed-dns-wireguard` --- ### 📝 Commits (1) - [`84175cd`](https://github.com/amnezia-vpn/amnezia-client/commit/84175cdf3159af10d590df4530a096966e47d720) fix: apply KillSwitch DNS exceptions for WireGuard/AWG on macOS and Linux ### 📊 Changes **2 files changed** (+2 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/platforms/linux/daemon/wireguardutilslinux.cpp` (+1 -0) 📝 `client/platforms/macos/daemon/wireguardutilsmacos.cpp` (+1 -0) </details> ### 📄 Description ## Problem With KillSwitch enabled and a WireGuard/AmneziaWG connection on macOS, DNS servers added under **Settings → KillSwitch → DNS exceptions** stay blocked. The address never shows up in the pf table: ``` sudo pfctl -a amn/310.blockDNS -t dnsaddr -T show ``` Adding it by hand (`pfctl ... -T add <ip>`) works only until the next (re)connect, because the table is replaced. ## Cause `WireguardUtilsMacos::addInterface()` (and `WireguardUtilsLinux::addInterface()`) build `FirewallParams::dnsServers` from `m_primaryDnsServer` and `m_secondaryDnsServer` only. `InterfaceConfig::m_allowedDnsServers` reaches the daemon (parsed in `daemon.cpp`), but these two platforms never use it. `KillSwitch::enableKillSwitch` (service path) and `WindowsFirewall` already include it. ## Fix Append `config.m_allowedDnsServers` to `params.dnsServers` in both daemons. This is a one-line change per platform. ## Notes - #3144 contains the same change for macOS as part of a larger feature. This PR is a minimal standalone fix that also covers Linux, so it can land independently. - Not built locally. It was found and verified against v5.0.0 on macOS, where the exception is missing from `dnsaddr` after connect. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amnezia-client#3142
No description provided.