private static function dnsResolve(array $url, NativeClientState $multi, array &$info, ?\Closure $onProgress): array
    {
        if ($port = parse_url($url['authority'], PHP_URL_PORT) ?: '') {
            $info['primary_port'] = $port;
            $port = ':'.$port;
        } else {
            $info['primary_port'] = 'http:' === $url['scheme'] ? 80 : 443;
        }

        $host = parse_url($url['authority'], PHP_URL_HOST);

        if (null === $ip = $multi->dnsCache[$host] ?? null) {
            $now = microtime(true);

            if (!$ip = gethostbynamel($host)) {
                throw new TransportException(sprintf('Could not resolve host "%s".', $host));
            }

            $info['namelookup_time'] += microtime(true) - $now;
            $multi->dnsCache[$host] = $ip = $ip[0];
        }

        $info['primary_ip'] = $ip;

        if ($onProgress) {
            // Notify DNS resolution
            $onProgress();
        }

        return [$host, $port, substr_replace($url['authority'], $ip, -\strlen($host) - \strlen($port), \strlen($host))];
    }