[PR #3406] fix(windows): run ipconfig /flushdns with separate arguments #3282

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

📋 Pull Request Information

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

Base: dev ← Head: fix/windows-flush-dns


📝 Commits (1)

  • 6f490ea fix(windows): run ipconfig /flushdns with separate arguments

📊 Changes

1 file changed (+1 additions, -3 deletions)

View changed files

📝 service/server/router_win.cpp (+1 -3)

📄 Description

Summary

Make RouterWin::flushDns() actually run ipconfig /flushdns.

Problem

flushDns() passes the whole command line to QProcess::start(command). In Qt 6 the single-string overload treats its argument as the program name, so Qt looks for an executable called ipconfig /flushdns, fails to start it and the method still returns true. The service calls flushDns on every connect and disconnect (VpnConnection::onConnectionStateChanged) and after re-resolving split tunneling sites, so cached DNS answers from before the tunnel came up were never dropped.

A standalone check against Qt 6.10.1 on Windows:

start("ipconfig /flushdns")       -> waitForStarted() = false, error = FailedToStart
start("ipconfig", {"/flushdns"})  -> waitForStarted() = true,  exitCode = 0

Changes

  • Start ipconfig with /flushdns as a separate argument, the same way RouterLinux starts systemctl.

Not changed

RouterWin::resetIpStack() has the same pattern for netsh int ip reset and netsh winsock reset, so those commands never run either. It is called on every connect, and both commands reset the Windows network stack and need a reboot to take effect, so making them run would be a behaviour change of its own. I left it as is.

Verification

  • Built the Windows x64 client, service and tests in Release mode (MSVC 19.35, Qt 6.10.1) against dev at ac175c8; ctest passes.
  • Confirmed the QProcess behaviour above with a standalone Qt program.

🔄 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/3406 **Author:** [@OverFitted](https://github.com/OverFitted) **Created:** 11/5/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/windows-flush-dns` --- ### 📝 Commits (1) - [`6f490ea`](https://github.com/amnezia-vpn/amnezia-client/commit/6f490ea7913eb021253706c6d50e641b30c4dfd3) fix(windows): run ipconfig /flushdns with separate arguments ### 📊 Changes **1 file changed** (+1 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `service/server/router_win.cpp` (+1 -3) </details> ### 📄 Description ## Summary Make `RouterWin::flushDns()` actually run `ipconfig /flushdns`. ## Problem `flushDns()` passes the whole command line to `QProcess::start(command)`. In Qt 6 the single-string overload treats its argument as the program name, so Qt looks for an executable called `ipconfig /flushdns`, fails to start it and the method still returns `true`. The service calls `flushDns` on every connect and disconnect (`VpnConnection::onConnectionStateChanged`) and after re-resolving split tunneling sites, so cached DNS answers from before the tunnel came up were never dropped. A standalone check against Qt 6.10.1 on Windows: ```text start("ipconfig /flushdns") -> waitForStarted() = false, error = FailedToStart start("ipconfig", {"/flushdns"}) -> waitForStarted() = true, exitCode = 0 ``` ## Changes - Start `ipconfig` with `/flushdns` as a separate argument, the same way `RouterLinux` starts `systemctl`. ## Not changed `RouterWin::resetIpStack()` has the same pattern for `netsh int ip reset` and `netsh winsock reset`, so those commands never run either. It is called on every connect, and both commands reset the Windows network stack and need a reboot to take effect, so making them run would be a behaviour change of its own. I left it as is. ## Verification - Built the Windows x64 client, service and tests in Release mode (MSVC 19.35, Qt 6.10.1) against `dev` at ac175c8; `ctest` passes. - Confirmed the `QProcess` behaviour above with a standalone Qt program. --- <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#3282
No description provided.