[GH-ISSUE #3376] Site split-tunneling domain addresses become stale and duplicate imports lose addresses #3237

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

Originally created by @makkoar on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3376

Describe the bug

I encountered destinations from my site exclusion list still using the VPN or timing out after connecting or reconnecting. The hostname/CIDR input and stored-address layer needs its own fix, independently of WG/AWG profile eligibility and Windows route installation.

At dev 3f6ecacff15e0ada890f6cf5174602d2b6b899c5:

  • duplicate JSON records with the same hostname overwrite each other's address lists;
  • cached hostname addresses are not refreshed before WG/AWG activation/reconnection;
  • a DNS lookup started in one route mode can finish after I select another mode and write into the wrong list;
  • URL-like input is handled through string replacement rather than URL parsing; invalid CIDR-like input can fall through to hostname/path normalization.

Current dev already preserves basic valid CIDRs and supports multiple stored addresses. This report does not claim those capabilities are entirely absent; it concerns the remaining normalization, import and address-lifecycle gaps.

Minimal import reproduction

Import the following into site split tunneling:

[
  {"hostname":"example.com","ips":["198.51.100.10"]},
  {"hostname":"example.com","ips":["198.51.100.20"]}
]

Expected: one hostname retaining both unique addresses.
Actual in the current import loop: the later sites.insert(normalizedHostname, ips) replaces the earlier address list.

These are documentation-only addresses; the reproduction concerns stored data, not connectivity to them.

For the DNS lifecycle, a domain's stored address can become stale between connections. Reconnecting should refresh successfully resolved addresses while preserving the last known addresses on DNS failure. An in-flight lookup must remain associated with the list in which it started and must not resurrect a deleted entry.

Expected behavior

  • Validate IPv4/CIDR entries before URL normalization; preserve valid prefixes and reject malformed ones.
  • Parse URLs/hostnames consistently, including case, IDNs and trailing dots.
  • Merge duplicate imported hostnames without losing addresses, retaining legacy single-IP compatibility.
  • Refresh WG/AWG domain entries before connection, with bounded concurrency, timeout and cancellation.
  • Refresh on reconnect and ignore obsolete lookup results; do not multiply reconnect callbacks.

Environment and verification limits

I originally encountered the problem on Windows with WG/AWG, public services with multiple IPv4 addresses, and a private hostname resolved through hosts. The existing combined patch was built and exercised on Windows; it is now being separated for review on current dev.

The normalization/storage code is shared. Pre-connect resolution in this patch is desktop WG/AWG-only and IPv4-only. It does not add wildcard-domain routing, continuous DNS monitoring, or prove the behavior of every mobile platform.

  • #2939 describes the earlier CIDR-prefix loss during import; basic preservation is already in current dev.
  • #2825 overlaps multi-address hostname/pre-connect resolution.
  • #3018 overlaps CIDR import regression coverage.
  • #3375 tracks the independent WG/AWG AllowedIPs eligibility/serialization problem.

Fix: #3380. Umbrella tracker: #3378. The sibling fixes are #3379 (AllowedIPs) and #3030 (Windows routes).

Originally created by @makkoar on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amnezia-client/issues/3376 ## Describe the bug I encountered destinations from my site exclusion list still using the VPN or timing out after connecting or reconnecting. The hostname/CIDR input and stored-address layer needs its own fix, independently of WG/AWG profile eligibility and Windows route installation. At dev `3f6ecacff15e0ada890f6cf5174602d2b6b899c5`: - duplicate JSON records with the same hostname overwrite each other's address lists; - cached hostname addresses are not refreshed before WG/AWG activation/reconnection; - a DNS lookup started in one route mode can finish after I select another mode and write into the wrong list; - URL-like input is handled through string replacement rather than URL parsing; invalid CIDR-like input can fall through to hostname/path normalization. Current dev already preserves basic valid CIDRs and supports multiple stored addresses. This report does not claim those capabilities are entirely absent; it concerns the remaining normalization, import and address-lifecycle gaps. ## Minimal import reproduction Import the following into site split tunneling: ```json [ {"hostname":"example.com","ips":["198.51.100.10"]}, {"hostname":"example.com","ips":["198.51.100.20"]} ] ``` Expected: one hostname retaining both unique addresses. Actual in the current import loop: the later `sites.insert(normalizedHostname, ips)` replaces the earlier address list. These are documentation-only addresses; the reproduction concerns stored data, not connectivity to them. For the DNS lifecycle, a domain's stored address can become stale between connections. Reconnecting should refresh successfully resolved addresses while preserving the last known addresses on DNS failure. An in-flight lookup must remain associated with the list in which it started and must not resurrect a deleted entry. ## Expected behavior - Validate IPv4/CIDR entries before URL normalization; preserve valid prefixes and reject malformed ones. - Parse URLs/hostnames consistently, including case, IDNs and trailing dots. - Merge duplicate imported hostnames without losing addresses, retaining legacy single-IP compatibility. - Refresh WG/AWG domain entries before connection, with bounded concurrency, timeout and cancellation. - Refresh on reconnect and ignore obsolete lookup results; do not multiply reconnect callbacks. ## Environment and verification limits I originally encountered the problem on Windows with WG/AWG, public services with multiple IPv4 addresses, and a private hostname resolved through hosts. The existing combined patch was built and exercised on Windows; it is now being separated for review on current dev. The normalization/storage code is shared. Pre-connect resolution in this patch is desktop WG/AWG-only and IPv4-only. It does not add wildcard-domain routing, continuous DNS monitoring, or prove the behavior of every mobile platform. ## Related work - #2939 describes the earlier CIDR-prefix loss during import; basic preservation is already in current dev. - #2825 overlaps multi-address hostname/pre-connect resolution. - #3018 overlaps CIDR import regression coverage. - #3375 tracks the independent WG/AWG AllowedIPs eligibility/serialization problem. Fix: #3380. Umbrella tracker: #3378. The sibling fixes are #3379 (AllowedIPs) and #3030 (Windows routes).
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#3237
No description provided.