Avoid infinite loop waiting for DNS resolution.