{
  "id": "unity/network-unitywebrequest-timeout",
  "signature": "UnityWebRequest: Timeout error: DNS resolution timed out",
  "signature_zh": "UnityWebRequest: 超时错误: DNS解析超时",
  "regex": "UnityWebRequest: Timeout error: DNS resolution timed out",
  "domain": "unity",
  "category": "network_error",
  "subcategory": null,
  "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.",
  "root_cause_type": "generic",
  "root_cause_zh": "UnityWebRequest在默认超时时间（通常10秒）内无法解析主机名，通常是由于网络配置问题、DNS服务器不可用或URL错误。",
  "versions": [
    {
      "version": "Unity 2021.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2022.3",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Unity 2023.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "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.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "IP addresses can change, and many services require hostname-based virtual hosting. This is not a scalable or reliable fix.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "The protocol does not affect DNS resolution; the error occurs before the HTTP handshake. This change is irrelevant.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "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.",
      "success_rate": 0.9,
      "how": "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.",
      "condition": "",
      "sources": []
    },
    {
      "action": "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);",
      "success_rate": 0.85,
      "how": "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);",
      "condition": "",
      "sources": []
    },
    {
      "action": "On mobile platforms, ensure that the app has the INTERNET permission (Android) or that network access is allowed in the Info.plist (iOS).",
      "success_rate": 0.8,
      "how": "On mobile platforms, ensure that the app has the INTERNET permission (Android) or that network access is allowed in the Info.plist (iOS).",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "检查URL是否有拼写错误，并确保主机名可通过浏览器或ping访问。如果URL正确，在设备的网络设置中配置自定义DNS服务器，或使用UnityWebRequest的timeout属性设置为合理值（例如15秒）以允许重试。",
    "实现带有指数退避的重试机制：如果请求因DNS超时而失败，等待2秒并重试最多3次。使用协程配合yield return new WaitForSecondsRealtime(2f);",
    "在移动平台上，确保应用程序具有INTERNET权限（Android）或在Info.plist中允许网络访问（iOS）。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.unity3d.com/ScriptReference/Networking.UnityWebRequest-timeout.html",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.9,
  "resolvable": "true",
  "first_seen": "2023-10-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}