Resolve to many IP addresses, check them one by one on connect

Fixes #746