Clarification on wildcard matching of domains in NEDNSSettings - matchDomains

I have an `NEPacketTunnelProvider` that's configured using `NEPacketTunnelNetworkSettings`. I'm using `NEDNSSettings` to configure the DNS resolver of the packet tunnel, and would like to specify the exact domains that should use this resolver using the `matchDomains` member variable.


While it's not explicitly mentioned in the documentation [1], I've noticed that if a domain is present in `matchDomains`, then all subdomains of it will also be resolved using this resolver, as if a wildcard match rule is in place.


I wanted to ask if this the intended behavior, and if so, is there any way to disable it so that only exact domain matches will be resolved?

I.e., if "example.com" is in the `matchDomains` list, I would like requests for this domain be resolved using the configured DNS resolver, while ignoring requests to the subdomain"test.example.com".


[1] matchDomains | Apple Developer Documentation


Posted on Mar 4, 2025 2:24 PM

Reply

Similar questions

3 replies

Mar 4, 2025 3:48 PM in response to Grant Bennet-Alder

Hi Grant, I appreciate the suggestion, thanks! I had originally tried to tag the question under the "Develop Forums" topic, but was met with a constant error stating that I should retry in a couple of minutes, when I would attempt to post -- hence the inappropriate discussion location. However, I totally missed the developer forums, so I'll post my question there instead.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Clarification on wildcard matching of domains in NEDNSSettings - matchDomains

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.