---
title: "expiredDNSBehavior(_:)"
framework: network
role: symbol
role_heading: Instance Method
path: "network/nwparametersprovider/expireddnsbehavior(_:)"
---

# expiredDNSBehavior(_:)

Allow or prohibit the use of expired DNS answers during connection establishment.

## Declaration

```swift
func expiredDNSBehavior(_ behavior: NWParameters.ExpiredDNSBehavior) -> Self
```

## Parameters

- `behavior`: The expired DNS behavior to use.

## Discussion

Discussion If allowed, a DNS answer that was previously returned may be re-used for new connections even after the answers are considered expired. A query for fresh answers will be sent in parallel, and the fresh answers will be used as alternate addresses in case the expired answers do not result in successful connections. By default, this value is .systemDefault, which allows the system to determine if it is appropriate to use expired answers.
