I am a bit confused about usage of searchDomains
of NEDNSSettings
and how different is it from matchDomains
. I understand that I can add few domains in matchDomains
which will be used to redirect DNS requests for provided domains and their subdomains to my NetworkExtension
. So, what is use of searchDomains
?
From docs it appears that it will work same as matchDomains
but only for exact FQDNs. And DNS requests for any subdomains would not redirected to NE but rather to system DNS resolver. Is that understanding correct?
If that understanding is correct, then what's the use of matchDomainsNoSearch
? Any domain in match domain would be a superset of same domain appended in searchDomains
? So why even append it?
If my understanding is not correct, then what's the use of searchDomains
?
So, what is use of searchDomains? From docs it appears that it will work same as matchDomains but only for exact FQDNs.
Right, so searchDomains
will be used as-is, for example, test.example.com
, whereas matchDomains
can be used for any subdomain of example.com
.
Regarding:
If that understanding is correct, then what's the use of matchDomainsNoSearch?
matchDomainsNoSearch
is a flag to determine if the matchDomains
should be appended to the searchDomains
. For example:
NEDNSSettings *dnsSettings = [[NEDNSSettings alloc] initWithServers:@[kLocalIP]];
dnsSettings.matchDomains = @[@“example.com”];
dnsSettings.matchDomainsNoSearch = YES;
This will NOT append example.com
to the end of domains being resolved.
Matt Eaton
DTS Engineering, CoreOS
meaton3@apple.com