Skip to content

[macOS] WireGuard connection fails with "could not set DNS: exit status 4" when virtual network interfaces are present #6171

@BloxburgSBS

Description

@BloxburgSBS

Describe the bug

Mysterium Dark GUI app fails to connect to any node with a WireGuard DNS error (exit status 4). This happens because the bundled update-resolv-conf script loops through ALL network services on macOS and tries to run networksetup -setdnsservers on each one, including virtual adapters like Tailscale and CyberGhost. Those virtual adapters dont accept DNS changes, so networksetup exits with code 4 and the whole connection fails.

This only started happening after i installed other VPN/networking tools (Tailscale, CyberGhost) which added extra network interfaces to my Mac. Before that the app was connecting fine.

To Reproduce

  1. Have a Mac with additional virtual network interfaces installed
  2. Open Mysterium Dark
  3. Select any node and click Connect
  4. Connection fails with the error below

My network services list looks like this:

$ networksetup -listallnetworkservices
An asterisk (*) denotes that a network service is disabled.
Thunderbolt Bridge
Wi-Fi
Tailscale
*CyberGhost

The script at Contents/Resources/app.asar.unpacked/node_modules/@mysteriumnetwork/node/bin/mac/arm64/config/update-resolv-conf tries to set DNS on ALL of these, and the virtual ones fail with exit code 4.

Expected behavior

The app should connect normally. The DNS update script should either skip virtual/non-physical network adapters, or handle the failure gracefully and continue with the adapters that work (like Wi-Fi).

Error Message

Oops! Could not connect
Failed to connect: could not start new connection: failed to start connection
endpoint: could not configure device: failed to create wg interface: could not
setup network: could not set DNS: exit status 4

Workaround

Patching the update-resolv-conf script to skip virtual adapters fixes it:

sudo sed -i '' 's/for i in `$NETWORKSETUP -listallnetworkservices | grep -v denotes`/for i in `$NETWORKSETUP -listallnetworkservices | grep -v denotes | grep -v Tailscale | grep -v CyberGhost | grep -v "Thunderbolt Bridge"`/' /Applications/MysteriumDark.app/Contents/Resources/app.asar.unpacked/node_modules/@mysteriumnetwork/node/bin/mac/arm64/config/update-resolv-conf

After that the GUI connected immediately with no issues.

Suggested fix

The update-resolv-conf script should probably only target active physical network interfaces, or at least handle failures on individual adapters without aborting the entire connection. Something like wrapping each networksetup call so one failure doesnt kill the whole thing.

Screenshots

Image

Desktop

  • OS: macOS 26.3
  • Architecture: arm64
  • App Version: Mysterium Dark (node version 1.29.2)

Additional context

This will probably affect anyone on macOS who has additional virtual network interfaces registered (from other VPN clients, networking tools, etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions