<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: 26.0.0 -",
    "macOS: 26.0.0 -",
    "tvOS: 26.0.0 -",
    "visionOS: 26.0.0 -",
    "watchOS: 26.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Network",
  "identifier" : "/documentation/Network/NWParametersProvider/expiredDNSBehavior(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Network"
    ],
    "preciseIdentifier" : "s:7Network20NWParametersProviderP18expiredDNSBehavioryxAA0B0C07ExpiredE0OF"
  },
  "title" : "expiredDNSBehavior(_:)"
}
-->

# expiredDNSBehavior(_:)

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

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

## Parameters

`behavior`

The expired DNS behavior to use.

## 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.

---

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)