Skip to content

[BUG] macOS ignores profile DNS for ordinary domains when using selective AllowedIPs #129

Closed

Description

@antailyaqwer

Environment

  • WG Tunnel Desktop 2.4.1
  • macOS
  • AmneziaWG profile with a DNS server and selective AllowedIPs

Problem

I want to use the DNS server specified in my profile for all system DNS queries while the tunnel is connected, while keeping selective IP routing.

With WG Tunnel, ordinary domain resolution continues to use the existing system DNS server. The same profile provides the desired DNS behavior in the standard AmneziaWG application.

Steps to reproduce

  1. Import an AmneziaWG profile with a DNS server in [Interface].
  2. Configure selective AllowedIPs that include the DNS server's address, without a default route through the VPN.
  3. Select Settings → DNS settings → Tunnel DNS mode → Default.
  4. Connect the tunnel.
  5. Inspect scutil --dns.
  6. Verify that the profile DNS server is reachable using dig @<profile-dns-address> example.com.

Actual behavior

The profile DNS server is reachable through the tunnel and responds to direct queries.

However, WG Tunnel registers it through /etc/resolver/wgtunnel.search. In scutil --dns, it appears under the domain wgtunnel.search, while the default resolver continues to use the existing system DNS server.

Expected behavior

Please support using the profile DNS servers for all system DNS queries while connected, independently of whether AllowedIPs contains a default route.

An explicit UI option would be sufficient. Selective IP routing should remain available, and disconnecting the tunnel should automatically remove the DNS override.

This is the behavior I expect from using the same profile in AmneziaWG.

Relevant source

WG Tunnel Desktop 2.4.1 depends on Core 1.9.9.

  • The macOS router passes HasAnyDefaultRoute() to the DNS setup function. Source
  • Global DNS is configured only when fullTunnel is true and DNS servers are present. Otherwise, WG Tunnel writes a resolver file. Source
  • The resolver file is named /etc/resolver/wgtunnel.search. Source
  • AmneziaWG 3.1.4 sets matchDomains = [""] when profile DNS servers are present. Source

The AmneziaWG comparison is based on my experience with the profile and the linked source. A controlled comparison between both applications was not performed during diagnosis.

Activity

  1. added a commit that references this issue on Nov 25, 2026
    7ab3951
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions