Add fault tolerance for resolve_hosts.