{
  "id": "python/aiohttp-client-connector-resolver-error",
  "signature": "aiohttp.client_exceptions.ClientConnectorDNSError: Cannot resolve hostname example.com",
  "signature_zh": "aiohttp 客户端连接器 DNS 错误：无法解析主机名 example.com",
  "regex": "aiohttp\\.client_exceptions\\.ClientConnectorDNSError:\\ Cannot\\ resolve\\ hostname\\ example\\.com",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "DNS resolution failed for the given hostname, possibly due to network issues or invalid domain.",
  "root_cause_type": "generic",
  "root_cause_zh": "给定主机名的 DNS 解析失败，可能是由于网络问题或无效域名。",
  "versions": [
    {
      "version": "3.10",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "3.11",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using IP address directly instead of hostname",
      "why_fails": "IP addresses may change, and SSL certificates may not match, causing other errors.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "Adding a custom hosts file entry without proper validation",
      "why_fails": "The entry may be incorrect or overridden by system settings.",
      "fail_rate": 0.4,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check DNS configuration and use a custom resolver",
      "success_rate": 0.85,
      "how": "from aiohttp.resolver import AsyncResolver\nresolver = AsyncResolver(nameservers=['8.8.8.8', '8.8.4.4'])\nconnector = aiohttp.TCPConnector(resolver=resolver)\nasync with aiohttp.ClientSession(connector=connector) as session:",
      "condition": "",
      "sources": []
    },
    {
      "action": "Implement retry with DNS fallback",
      "success_rate": 0.8,
      "how": "import socket\ntry:\n    socket.gethostbyname('example.com')\nexcept socket.gaierror:\n    # fallback to IP or alternative hostname",
      "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.83,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-03-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}