title: Docker swarm nodes in the same overlay network can't see each other
body: <p>I have a weird problem in my swarm, docker services inside of the same network can't communicate, I get the following error when I try to communicate between them:</p>
  
  <pre><code>could not translate host name "dev_db" to address: Temporary failure in name resolution
  </code></pre>
  
  <p>I have been investigating if they are on the same network and according to inspect they are in the same Network overlay: </p>
  
  <pre><code>docker service inspect dev_slavedb
  [
      {
          "ID": "flcwn7p17lgy6f9ad89iqas0e",
          "Version": {
              "Index": 68009
          },
          "CreatedAt": "2018-01-06T00:33:22.602060695Z",
          "UpdatedAt": "2018-01-06T00:33:22.603561612Z",
          "Spec": {
              "Name": "dev_slavedb",
              "Labels": {},
              "TaskTemplate": {
                  "ContainerSpec": {
                      "Image": "postgres:latest@sha256:3f4441460029e12905a5d447a3549ae2ac13323d045391b0cb0cf8b48ea17463",
                      "Env": [
                          "POSTGRES_USER=mydatabase",
                          "POSTGRES_PASSWORD=mydatabase"
                      ],
                      "Mounts": [
                          {
                              "Type": "volume",
                              "Source": "slave_postgres",
                              "Target": "/var/lib/postgresql/data"
                          }
                      ],
                      "StopGracePeriod": 10000000000,
                      "DNSConfig": {}
                  },
                  "Resources": {
                      "Limits": {},
                      "Reservations": {}
                  },
                  "RestartPolicy": {
                      "Condition": "any",
                      "Delay": 5000000000,
                      "MaxAttempts": 0
                  },
                  "Placement": {
                      "Constraints": [
                          "node.hostname==swarm02"
                      ],
                      "Platforms": [
                          {
                              "Architecture": "amd64",
                              "OS": "linux"
                          },
                          {
                              "OS": "linux"
                          },
                          {
                              "OS": "linux"
                          },
                          {
                              "Architecture": "arm64",
                              "OS": "linux"
                          },
                          {
                              "Architecture": "386",
                              "OS": "linux"
                          },
                          {
                              "Architecture": "ppc64le",
                              "OS": "linux"
                          },
                          {
                              "Architecture": "s390x",
                              "OS": "linux"
                          }
                      ]
                  },
                  "Networks": [
                      {
                          "Target": "hh8zmhc9gx0p9iwukozo31dgs"
                      }
                  ],
                  "ForceUpdate": 0,
                  "Runtime": "container"
              },
              "Mode": {
                  "Replicated": {
                      "Replicas": 1
                  }
              },
              "UpdateConfig": {
                  "Parallelism": 1,
                  "FailureAction": "pause",
                  "Monitor": 5000000000,
                  "MaxFailureRatio": 0,
                  "Order": "stop-first"
              },
              "RollbackConfig": {
                  "Parallelism": 1,
                  "FailureAction": "pause",
                  "Monitor": 5000000000,
                  "MaxFailureRatio": 0,
                  "Order": "stop-first"
              },
              "EndpointSpec": {
                  "Mode": "vip",
                  "Ports": [
                      {
                          "Protocol": "tcp",
                          "TargetPort": 5432,
                          "PublishedPort": 5432,
                          "PublishMode": "host"
                      }
                  ]
              }
          },
          "Endpoint": {
              "Spec": {
                  "Mode": "vip",
                  "Ports": [
                      {
                          "Protocol": "tcp",
                          "TargetPort": 5432,
                          "PublishedPort": 5432,
                          "PublishMode": "host"
                      }
                  ]
              },
              "Ports": [
                  {
                      "Protocol": "tcp",
                      "TargetPort": 5432,
                      "PublishedPort": 5432,
                      "PublishMode": "host"
                  }
              ],
              "VirtualIPs": [
                  {
                      "NetworkID": "hh8zmhc9gx0p9iwukozo31dgs",
                      "Addr": "10.0.0.4/24"
                  }
              ]
          }
      }
  ]
  
  
  
  
  
  docker service inspect dev_db
  [
      {
          "ID": "jqwmzoe57lonbr0wwnp262x9i",
          "Version": {
              "Index": 68001
          },
          "CreatedAt": "2018-01-06T00:30:50.284998521Z",
          "UpdatedAt": "2018-01-06T00:30:50.285963303Z",
          "Spec": {
              "Name": "dev_db",
              "Labels": {},
              "TaskTemplate": {
                  "ContainerSpec": {
                      "Image": "postgres:latest@sha256:3f4441460029e12905a5d447a3549ae2ac13323d045391b0cb0cf8b48ea17463",
                      "Env": [
                          "POSTGRES_USER=mydatabase",
                          "POSTGRES_PASSWORD=mydatabase"
                      ],
                      "Mounts": [
                          {
                              "Type": "volume",
                              "Source": "postgres",
                              "Target": "/var/lib/postgresql/data"
                          }
                      ],
                      "StopGracePeriod": 10000000000,
                      "DNSConfig": {}
                  },
                  "Resources": {
                      "Limits": {},
                      "Reservations": {}
                  },
                  "RestartPolicy": {
                      "Condition": "any",
                      "Delay": 5000000000,
                      "MaxAttempts": 0
                  },
                  "Placement": {
                      "Constraints": [
                          "node.hostname==swarm01"
                      ],
                      "Platforms": [
                          {
                              "Architecture": "amd64",
                              "OS": "linux"
                          },
                          {
                              "OS": "linux"
                          },
                          {
                              "OS": "linux"
                          },
                          {
                              "Architecture": "arm64",
                              "OS": "linux"
                          },
                          {
                              "Architecture": "386",
                              "OS": "linux"
                          },
                          {
                              "Architecture": "ppc64le",
                              "OS": "linux"
                          },
                          {
                              "Architecture": "s390x",
                              "OS": "linux"
                          }
                      ]
                  },
                  "Networks": [
                      {
                          "Target": "hh8zmhc9gx0p9iwukozo31dgs"
                      }
                  ],
                  "ForceUpdate": 0,
                  "Runtime": "container"
              },
              "Mode": {
                  "Replicated": {
                      "Replicas": 1
                  }
              },
              "UpdateConfig": {
                  "Parallelism": 1,
                  "FailureAction": "pause",
                  "Monitor": 5000000000,
                  "MaxFailureRatio": 0,
                  "Order": "stop-first"
              },
              "RollbackConfig": {
                  "Parallelism": 1,
                  "FailureAction": "pause",
                  "Monitor": 5000000000,
                  "MaxFailureRatio": 0,
                  "Order": "stop-first"
              },
              "EndpointSpec": {
                  "Mode": "vip",
                  "Ports": [
                      {
                          "Protocol": "tcp",
                          "TargetPort": 5432,
                          "PublishedPort": 5432,
                          "PublishMode": "host"
                      }
                  ]
              }
          },
          "Endpoint": {
              "Spec": {
                  "Mode": "vip",
                  "Ports": [
                      {
                          "Protocol": "tcp",
                          "TargetPort": 5432,
                          "PublishedPort": 5432,
                          "PublishMode": "host"
                      }
                  ]
              },
              "Ports": [
                  {
                      "Protocol": "tcp",
                      "TargetPort": 5432,
                      "PublishedPort": 5432,
                      "PublishMode": "host"
                  }
              ],
              "VirtualIPs": [
                  {
                      "NetworkID": "hh8zmhc9gx0p9iwukozo31dgs",
                      "Addr": "10.0.0.2/24"
                  }
              ]
          }
      }
  ]
  </code></pre>
  
  <p>Even when I try to use their VIPs (10.0.0.2 and 10.0.0.4) I also get the same error. I don't know how to troubleshoot this, any ideas are appreciated. </p>