{
  "id": "docker/network-not-connecting-to-swarm",
  "signature": "Error response from daemon: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing: dial tcp: lookup tasks.manager on 127.0.0.11:53: no such host\"",
  "signature_zh": "来自守护进程的错误响应：rpc 错误：代码 = Unavailable 描述 = 连接错误：描述 = \"传输：拨号时出错：拨号 tcp：在 127.0.0.11:53 上查找 tasks.manager：没有这样的主机\"",
  "regex": "lookup tasks\\.manager on 127\\.0\\.0\\.11:53: no such host",
  "domain": "docker",
  "category": "network_error",
  "subcategory": null,
  "root_cause": "A Docker Swarm service cannot resolve the internal DNS name 'tasks.manager' because the overlay network is not properly attached or the swarm manager node is unreachable due to DNS resolution failure.",
  "root_cause_type": "generic",
  "root_cause_zh": "Docker Swarm 服务无法解析内部 DNS 名称 'tasks.manager'，因为 overlay 网络未正确附加，或者由于 DNS 解析失败导致 swarm 管理器节点不可达。",
  "versions": [
    {
      "version": "Docker 24.0.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Swarm 1.2.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Linux 5.15.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Restart the Docker daemon on all nodes",
      "why_fails": "Restarting does not fix the overlay network configuration or DNS resolver issue; the error reappears.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Manually add 'tasks.manager' to /etc/hosts inside the container",
      "why_fails": "The tasks.manager name is dynamically resolved by Swarm's internal DNS; static entries conflict with overlay network routing.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Set '--dns 8.8.8.8' in docker service create",
      "why_fails": "External DNS cannot resolve internal Swarm names like tasks.manager; this breaks service discovery.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Ensure the service is attached to an overlay network: 'docker service update --network-add my-overlay myservice'. Then verify with 'docker service ps myservice' and check DNS resolution inside the container with 'docker exec <container> nslookup tasks.manager'.",
      "success_rate": 0.8,
      "how": "Ensure the service is attached to an overlay network: 'docker service update --network-add my-overlay myservice'. Then verify with 'docker service ps myservice' and check DNS resolution inside the container with 'docker exec <container> nslookup tasks.manager'.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Reinitialize the swarm on the manager node: 'docker swarm leave --force' then 'docker swarm init --advertise-addr <manager-ip>'. Rejoin worker nodes with the new token.",
      "success_rate": 0.75,
      "how": "Reinitialize the swarm on the manager node: 'docker swarm leave --force' then 'docker swarm init --advertise-addr <manager-ip>'. Rejoin worker nodes with the new token.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "确保服务已附加到 overlay 网络：'docker service update --network-add my-overlay myservice'。然后使用 'docker service ps myservice' 验证，并在容器内使用 'docker exec <container> nslookup tasks.manager' 检查 DNS 解析。",
    "在管理器节点上重新初始化 swarm：'docker swarm leave --force' 然后 'docker swarm init --advertise-addr <manager-ip>'。使用新令牌重新加入工作节点。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://docs.docker.com/engine/swarm/networking/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.84,
  "fix_success_rate": 0.76,
  "resolvable": "partial",
  "first_seen": "2023-12-18",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}