# UnityWebRequest: Timeout error: DNS resolution timed out

- **ID:** `unity/network-unitywebrequest-timeout`
- **Domain:** unity
- **Category:** network_error
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

The UnityWebRequest could not resolve the hostname within the default timeout period (typically 10 seconds), often due to network configuration issues, DNS server unavailability, or incorrect URL.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Unity 2021.3 | active | — | — |
| Unity 2022.3 | active | — | — |
| Unity 2023.1 | active | — | — |

## Workarounds

1. **Check the URL for typos and ensure the hostname is reachable via a web browser or ping. If the URL is correct, configure a custom DNS server in the device's network settings or use UnityWebRequest's timeout property to a reasonable value (e.g., 15 seconds) to allow retries.** (90% success)
   ```
   Check the URL for typos and ensure the hostname is reachable via a web browser or ping. If the URL is correct, configure a custom DNS server in the device's network settings or use UnityWebRequest's timeout property to a reasonable value (e.g., 15 seconds) to allow retries.
   ```
2. **Implement a retry mechanism with exponential backoff: if the request fails with DNS timeout, wait 2 seconds and retry up to 3 times. Use a coroutine with yield return new WaitForSecondsRealtime(2f);** (85% success)
   ```
   Implement a retry mechanism with exponential backoff: if the request fails with DNS timeout, wait 2 seconds and retry up to 3 times. Use a coroutine with yield return new WaitForSecondsRealtime(2f);
   ```
3. **On mobile platforms, ensure that the app has the INTERNET permission (Android) or that network access is allowed in the Info.plist (iOS).** (80% success)
   ```
   On mobile platforms, ensure that the app has the INTERNET permission (Android) or that network access is allowed in the Info.plist (iOS).
   ```

## Dead Ends

- **** — This only delays the error; if DNS resolution fails permanently, the request will eventually time out anyway. It does not fix the underlying DNS issue. (90% fail)
- **** — IP addresses can change, and many services require hostname-based virtual hosting. This is not a scalable or reliable fix. (85% fail)
- **** — The protocol does not affect DNS resolution; the error occurs before the HTTP handshake. This change is irrelevant. (95% fail)
