[PR #2273] Fix custom DNS for non-Admin profiles + preserve DNS order in Android WireGuard #2736

Open
opened 2026-10-14 21:04:23 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/amnezia-vpn/amnezia-client/pull/2273
Author: @ilsme
Created: 2/24/2026
Status: 🔄 Open

Base: dev ← Head: pr/android-custom-dns-wg


📝 Commits (2)

  • 452135b fix: honor app custom DNS for non-API connection profiles (#1591)
  • 24d3ffe fix: preserve primary/secondary DNS order for Android WireGuard (#1591)

📊 Changes

2 files changed (+20 additions, -5 deletions)

View changed files

📝 client/android/protocolApi/src/main/kotlin/ProtocolConfig.kt (+2 -1)
📝 client/ui/models/servers_model.cpp (+18 -4)

📄 Description

Problem

For non-API profiles (config_version == 0), Custom DNS from app settings could be ignored.
This was especially visible for shared/imported self-hosted profiles, where DNS embedded in the profile overrode GUI Custom DNS.

Additionally, Android WireGuard could apply DNS in the wrong primary/secondary order.

Root cause

  • DNS selection for non-API profiles did not consistently prioritize app DNS settings.
  • ServersModel::getDnsPair() was not strictly tied to the requested server index.
  • Android WG config generation did not preserve DNS order from input.

Solution

  • Updated ServersModel::getDnsPair(serverIndex) to always use the requested serverIndex.
  • For non-API profiles (config_version == 0), prefer app Custom DNS (primaryDns/secondaryDns).
  • Kept API-config behavior unchanged (server-provided DNS is still used there).
  • Preserved primary/secondary DNS order in Android WireGuard config generation.

Result

  • Custom DNS now works for shared/imported non-API profiles (including self-hosted flows).
  • Android WireGuard keeps DNS order exactly as configured.

🔄 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/2273 **Author:** [@ilsme](https://github.com/ilsme) **Created:** 2/24/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `pr/android-custom-dns-wg` --- ### 📝 Commits (2) - [`452135b`](https://github.com/amnezia-vpn/amnezia-client/commit/452135bd23964e3e33446adc38214be26dc46819) fix: honor app custom DNS for non-API connection profiles (#1591) - [`24d3ffe`](https://github.com/amnezia-vpn/amnezia-client/commit/24d3ffe1ef78e28e9e35b7e5161ca0f03aba17d7) fix: preserve primary/secondary DNS order for Android WireGuard (#1591) ### 📊 Changes **2 files changed** (+20 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `client/android/protocolApi/src/main/kotlin/ProtocolConfig.kt` (+2 -1) 📝 `client/ui/models/servers_model.cpp` (+18 -4) </details> ### 📄 Description ## Problem For non-API profiles (`config_version == 0`), Custom DNS from app settings could be ignored. This was especially visible for shared/imported self-hosted profiles, where DNS embedded in the profile overrode GUI Custom DNS. Additionally, Android WireGuard could apply DNS in the wrong primary/secondary order. ## Root cause - DNS selection for non-API profiles did not consistently prioritize app DNS settings. - `ServersModel::getDnsPair()` was not strictly tied to the requested server index. - Android WG config generation did not preserve DNS order from input. ## Solution - Updated `ServersModel::getDnsPair(serverIndex)` to always use the requested `serverIndex`. - For non-API profiles (`config_version == 0`), prefer app Custom DNS (`primaryDns`/`secondaryDns`). - Kept API-config behavior unchanged (server-provided DNS is still used there). - Preserved primary/secondary DNS order in Android WireGuard config generation. ## Result - Custom DNS now works for shared/imported non-API profiles (including self-hosted flows). - Android WireGuard keeps DNS order exactly as configured. ## Related issues - #1591 --- <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#2736
No description provided.