---
title: "requireEncryptedNameResolution(_:fallbackResolver:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/nwparameters/privacycontext/requireencryptednameresolution(_:fallbackresolver:)"
---

# requireEncryptedNameResolution(_:fallbackResolver:)

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

## Declaration

```swift
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

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

## See Also

### Requiring Encrypted DNS

- [NWParameters.PrivacyContext.ResolverConfiguration](network/nwparameters/privacycontext/resolverconfiguration.md)
