diff --git a/client/client.go b/client/client.go index 5b6f1238e..8e6b3210c 100644 --- a/client/client.go +++ b/client/client.go @@ -602,6 +602,16 @@ func (c *Client) SetServers(in []string) error { continue } + // Try to ping to check if it is a real server + ok, err := c.Ping(addr) + if err != nil { + merr.Errors = append(merr.Errors, fmt.Errorf("Server at address %s failed ping: %v", addr, err)) + continue + } else if !ok { + merr.Errors = append(merr.Errors, fmt.Errorf("Server at address %s didn't respond to ping", addr)) + continue + } + endpoints = append(endpoints, &servers.Server{Addr: addr}) }