Skip to content

Repurpose DNS domains with match/search policy#339

Merged
keeshux merged 8 commits intomasterfrom
feature/dns-match-domains
Apr 10, 2026
Merged

Repurpose DNS domains with match/search policy#339
keeshux merged 8 commits intomasterfrom
feature/dns-match-domains

Conversation

@keeshux
Copy link
Copy Markdown
Member

@keeshux keeshux commented Apr 6, 2026

Steps:

  • Merge domainName and searchDomains into domains in the DNSModule builder
  • Assume the first search domain to be the domain name through a .isFirstDomainPrimary flag
  • Add an optional .domainPolicy field to fine-tune the semantics of the domains list

The default policy, when unset, is to use the list of domains for both:

  • Match: Apply the DNS settings only to those domains
  • Search: Use the domains to look up short hostnames

"Match" and "Search" behavior can be picked selectively by setting an explicit policy, but the common user expectation for split DNS setups is that both semantics apply. If the VPN is the default gateway, match domains are ignored anyway.

Apply part of the reasoning behind WireGuard/wireguard-apple#11, but make it about NE rather than WireGuard, because it's a DNS concern.

Be defensive about DoH/DoT for now, as I haven't tested if .matchDomains is still effective with empty bootstrap DNS servers. In that case, we clear the field to avoid known quirks with Network Extension.

@keeshux keeshux self-assigned this Apr 6, 2026
@keeshux keeshux added enhancement New feature or request NE Apple Network Extension labels Apr 6, 2026
@keeshux keeshux moved this to In Progress in 2026 Q1 Cross-platform ABI Apr 6, 2026
@keeshux keeshux added this to the 1.0.0 milestone Apr 6, 2026
@keeshux keeshux force-pushed the feature/dns-match-domains branch from f5c6b10 to acb4995 Compare April 10, 2026 10:45
@keeshux keeshux changed the title Add match domains to DNSModule Repurpose domains with match/search policy Apr 10, 2026
@keeshux keeshux changed the title Repurpose domains with match/search policy DNS: Repurpose domains with match/search policy Apr 10, 2026
@keeshux keeshux changed the title DNS: Repurpose domains with match/search policy Repurpose DNS domains with match/search policy Apr 10, 2026
@keeshux keeshux marked this pull request as ready for review April 10, 2026 11:20
@keeshux keeshux merged commit 50c1c94 into master Apr 10, 2026
@keeshux keeshux deleted the feature/dns-match-domains branch April 10, 2026 11:21
@keeshux keeshux moved this from In Progress to Done in 2026 Q1 Cross-platform ABI Apr 10, 2026
@keeshux keeshux modified the milestones: 1.0.0, DNS enhancements Apr 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request NE Apple Network Extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant