# DnsOptions.StaleDnsOptions


```
class DnsOptions.StaleDnsOptions
```

<br />

*** ** * ** ***

A class configuring Cronet's stale DNS functionality.

DNS resolution is one of the steps on the critical path to making a URL request, but it can be slow for various reasons (underlying network latency, buffer bloat, packet loss, etc.).

Depending on the use case, it might be worthwhile for an app developer to trade off guaranteed DNS record freshness for better availability of DNS records.

Stale results can include both:

- results returned from the current network's DNS server, but past their time-to-live, and
- results returned from a previous network's DNS server, whether expired or not.

## Summary

| ### Nested types |
|---|
| `class https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions.Builder` Builder for `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions`. |

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions.Builder!` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions#builder()()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html?` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions#getAllowCrossNetworkUsage()()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions#getFreshLookupTimeoutMillis()()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html?` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions#getMaxExpiredDelayMillis()()` |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html?` | `https://developer.android.com/develop/connectivity/cronet/reference/kotlin/org/chromium/net/DnsOptions.StaleDnsOptions#getUseStaleOnNameNotResolved()()` |

## Public functions

### builder

```
java-static fun builder(): DnsOptions.StaleDnsOptions.Builder!
```

### getAllowCrossNetworkUsage

```
fun getAllowCrossNetworkUsage(): Boolean?
```

### getFreshLookupTimeoutMillis

```
fun getFreshLookupTimeoutMillis(): Long?
```

### getMaxExpiredDelayMillis

```
fun getMaxExpiredDelayMillis(): Long?
```

### getUseStaleOnNameNotResolved

```
fun getUseStaleOnNameNotResolved(): Boolean?
```