{
  "id": "python/httpx-connecterror-dns-resolution-failure",
  "signature": "httpx.ConnectError: [Errno -2] Name or service not known while connecting to 'nonexistent.example.com'",
  "signature_zh": "httpx.ConnectError: [Errno -2] 名称或服务未知，连接到'nonexistent.example.com'时",
  "regex": "httpx\\.ConnectError:\\ \\[Errno\\ \\-2\\]\\ Name\\ or\\ service\\ not\\ known\\ while\\ connecting\\ to\\ 'nonexistent\\.example\\.com'",
  "domain": "python",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "The hostname cannot be resolved by the system's DNS resolver.",
  "root_cause_type": "generic",
  "root_cause_zh": "系统DNS解析器无法解析主机名。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Using a different DNS resolver in code without system changes",
      "why_fails": "httpx uses the system resolver by default; custom resolver requires extra setup.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Ignoring the error and retrying",
      "why_fails": "DNS failure persists across retries.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Use a working DNS server like Google's 8.8.8.8",
      "success_rate": 0.85,
      "how": "# On Linux: echo 'nameserver 8.8.8.8' > /etc/resolv.conf\n# Or use socket.create_connection with IP address",
      "condition": "",
      "sources": []
    },
    {
      "action": "Replace hostname with IP address in the request",
      "success_rate": 0.7,
      "how": "httpx.get('http://93.184.216.34')  # example.com IP",
      "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.84,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-02-20",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}