[PR #3404] fix(core): honour Use AmneziaDNS switch for all server types #3281

Open
opened 2026-11-07 17:58:55 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/3404
Author: @Stalinko
Created: 11/5/2026
Status: 🔄 Open

Base: dev ← Head: fix/amnezia-dns-toggle


📝 Commits (1)

  • 008dd11 fix(core): honour Use AmneziaDNS switch for all server types

📊 Changes

1 file changed (+5 additions, -0 deletions)

View changed files

📝 client/core/controllers/connectionController.cpp (+5 -0)

📄 Description

Problem

With Settings → Connection → Use AmneziaDNS turned off, the client still connects with AmneziaDNS (172.29.172.254).

getDnsPair() prefers a DNS saved in the server config over the switch:

  • SelfHostedAdminServerConfig::getDnsPair() checks the switch only when no DNS is saved.
  • SelfHostedUserServerConfig, NativeServerConfig and ApiV2ServerConfig don't check it at all.

A shared vpn:// key gets AmneziaDNS saved in it whenever the admin's switch was on at export time (ExportController writes the resolved DNS into the key). After that, the recipient's switch and custom DNS servers have no effect.

Fix

In ConnectionController::prepareConnection(), after the DNS pair is resolved for any server type: if the switch is off and the primary DNS is AmneziaDNS, use the user's DNS servers instead.

This is one check where every connection passes, so it covers self-hosted, shared, native and Premium/Free configs. Nothing changes while the switch is on, or when the saved DNS is anything other than AmneziaDNS.

Testing

Not built or run locally. Please let CI build it. To check manually: import a shared key that has AmneziaDNS saved in it, turn Use AmneziaDNS off, connect, and confirm the tunnel uses the DNS servers from Settings → Connection → DNS servers.

🤖 Generated with Claude Code


🔄 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/3404 **Author:** [@Stalinko](https://github.com/Stalinko) **Created:** 11/5/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/amnezia-dns-toggle` --- ### 📝 Commits (1) - [`008dd11`](https://github.com/amnezia-vpn/amnezia-client/commit/008dd11f3c0eb38916766694b954a0396b340db3) fix(core): honour Use AmneziaDNS switch for all server types ### 📊 Changes **1 file changed** (+5 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `client/core/controllers/connectionController.cpp` (+5 -0) </details> ### 📄 Description ## Problem With **Settings → Connection → Use AmneziaDNS** turned off, the client still connects with AmneziaDNS (`172.29.172.254`). `getDnsPair()` prefers a DNS saved in the server config over the switch: - `SelfHostedAdminServerConfig::getDnsPair()` checks the switch only when no DNS is saved. - `SelfHostedUserServerConfig`, `NativeServerConfig` and `ApiV2ServerConfig` don't check it at all. A shared `vpn://` key gets AmneziaDNS saved in it whenever the admin's switch was on at export time (`ExportController` writes the resolved DNS into the key). After that, the recipient's switch and custom DNS servers have no effect. ## Fix In `ConnectionController::prepareConnection()`, after the DNS pair is resolved for any server type: if the switch is off and the primary DNS is AmneziaDNS, use the user's DNS servers instead. This is one check where every connection passes, so it covers self-hosted, shared, native and Premium/Free configs. Nothing changes while the switch is on, or when the saved DNS is anything other than AmneziaDNS. ## Testing Not built or run locally. Please let CI build it. To check manually: import a shared key that has AmneziaDNS saved in it, turn **Use AmneziaDNS** off, connect, and confirm the tunnel uses the DNS servers from **Settings → Connection → DNS servers**. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <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#3281
No description provided.