{
  "id": "python/httpx-connecttimeout-dns-resolution",
  "signature": "httpx.ConnectTimeout: Connection timed out after 5000ms to host 'api.example.com' (DNS resolution failed)",
  "signature_zh": "httpx.ConnectTimeout: 连接到主机'api.example.com'超时（5000毫秒后），DNS解析失败",
  "regex": "httpx\\.ConnectTimeout:\\ Connection\\ timed\\ out\\ after\\ 5000ms\\ to\\ host\\ 'api\\.example\\.com'\\ \\(DNS\\ resolution\\ failed\\)",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The DNS server cannot resolve the hostname, possibly due to network misconfiguration or DNS server unavailability.",
  "root_cause_type": "generic",
  "root_cause_zh": "DNS服务器无法解析主机名，可能是由于网络配置错误或DNS服务器不可用。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increasing timeout to a very high value",
      "why_fails": "Timeout increase does not fix DNS resolution; the request will still hang if DNS fails.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Restarting the application without checking DNS configuration",
      "why_fails": "The underlying DNS issue persists across restarts.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use an IP address directly instead of hostname",
      "success_rate": 0.7,
      "how": "client = httpx.Client()\nresponse = client.get('http://93.184.216.34')",
      "condition": "",
      "sources": []
    },
    {
      "action": "Configure a custom DNS resolver in the system or use a different DNS server",
      "success_rate": 0.9,
      "how": "import socket\nsocket.setdefaulttimeout(10)\n# Or change /etc/resolv.conf (Linux) or network settings (Windows)",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-02-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}