---
title: allowsPersistentDNS
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/urlrequest/allowspersistentdns
---

# allowsPersistentDNS

true if the request is allowed to store and use DNS answers, potentially beyond TTL expiry, in a persistent per-process cache, false otherwise. Defaults to false. This should only be set to true for hostnames whose resolutions are not expected to change across networks.

## Declaration

```swift
var allowsPersistentDNS: Bool { get set }
```

## See Also

### Controlling request behavior

- [timeoutInterval](foundation/urlrequest/timeoutinterval.md)
- [httpShouldHandleCookies](foundation/urlrequest/httpshouldhandlecookies.md)
- [httpShouldUsePipelining](foundation/urlrequest/httpshouldusepipelining.md)
- [allowsCellularAccess](foundation/urlrequest/allowscellularaccess.md)
- [assumesHTTP3Capable](foundation/urlrequest/assumeshttp3capable.md)
- [cookiePartitionIdentifier](foundation/urlrequest/cookiepartitionidentifier.md)
- [requiresDNSSECValidation](foundation/urlrequest/requiresdnssecvalidation.md)
