<!--
{
  "availability" : [
    "iOS: 14.0.0 -",
    "iPadOS: 14.0.0 -",
    "macCatalyst: 14.0.0 -",
    "macOS: 11.0.0 -",
    "tvOS: 14.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 7.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWParameters/PrivacyContext/requireEncryptedNameResolution(_:fallbackResolver:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network12NWParametersC14PrivacyContextC30requireEncryptedNameResolution_16fallbackResolverySb_AE0J13ConfigurationOSgtF"
  },
  "title" : "requireEncryptedNameResolution(_:fallbackResolver:)"
}
-->

# requireEncryptedNameResolution(_:fallbackResolver:)

Requires that any DNS name resolution for connections associated with this context use encrypted transports, such as TLS or HTTPS.

```
func requireEncryptedNameResolution(_ requireEncryption: Bool, fallbackResolver: NWParameters.PrivacyContext.ResolverConfiguration?)
```

## Parameters

`requireEncryption`

A Boolean that indicates whether your connections prohibits unencrypted name resolution.

`fallbackResolver`

An encrypted DNS resolver configuration that your connections use if the system doesn’t have a preferred encrypted resolver.

## Discussion

Connections that use iCloud Private Relay automatically use encrypted name resolution. When active, name resolution uses iCloud Private Relay instead of the `fallbackResolver`.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)