Since the sample code was provided in Swift, I want to confirm that the following code in Objective-C will configure NSURLSession to use encrypted DNS and that you can have more than one fallback resolver:
Code Block objective-c nw_privacy_context_t defaultPrivacyContext = NW_DEFAULT_PRIVACY_CONTEXT; nw_endpoint_t dohResolverEndpoint = nw_endpoint_create_url("https://dnsserver.example.net/dns-query"); nw_endpoint_t v4ResolverEndpoint = nw_endpoint_create_host("1.1.1.1", "443"); nw_endpoint_t v6ResolverEndpoint = nw_endpoint_create_host("2606:4700:4700::1111", "443"); nw_resolver_config_t fallbackResolvers = nw_resolver_config_create_https(dohResolverEndpoint); nw_resolver_config_add_server_address(fallbackResolvers, v4ResolverEndpoint); nw_resolver_config_add_server_address(fallbackResolvers, v6ResolverEndpoint); nw_privacy_context_require_encrypted_name_resolution(defaultPrivacyContext, true, fallbackResolvers);