# php -r '$url="https://developers.google.com/static/crawling/ipranges/common-crawlers.json"; $host=parse_url($url, PHP_URL_HOST); $records=dns_get_record($host, DNS_A + DNS_AAAA); $resolve=[]; foreach ($records as $r) { $ip=!empty($r["ip"]) ?
$r["ip"] : (!empty($r["ipv6"]) ? $r["ipv6"] : ""); if ($ip) { $resolve[]=$host . ":443:" . (strpos($ip, ":") !== false ? "[".$ip."]" : $ip); } } $ch=curl_init($url); curl_setopt_array($ch,
[CURLOPT_RETURNTRANSFER=>true,CURLOPT_FOLLOWLOCATION=>false,CURLOPT_TIMEOUT=>20,CURLOPT_CONNECTTIMEOUT=>5,CURLOPT_HTTPHEADER=>["Accept: application/json","User-Agent: XF-Bot-Guard (+https://xenforo.com/community/resources/xf-bot-
guard.10508/)"],CURLOPT_RESOLVE=>$resolve]); $body=curl_exec($ch); var_dump($resolve, ["errno"=>curl_errno($ch),"error"=>curl_error($ch),"status"=>curl_getinfo($ch,CURLINFO_RESPONSE_CODE),"bytes"=>strlen((string)$body)]);'
array(10) {
[0]=>
string(40) "developers.google.com:443:142.251.30.102"
[1]=>
string(40) "developers.google.com:443:142.251.30.100"
[2]=>
string(40) "developers.google.com:443:142.251.30.138"
[3]=>
string(40) "developers.google.com:443:142.251.30.113"
[4]=>
string(40) "developers.google.com:443:142.251.30.139"
[5]=>
string(40) "developers.google.com:443:142.251.30.101"
[6]=>
string(50) "developers.google.com:443:[2a00:1450:4009:c19::64]"
[7]=>
string(50) "developers.google.com:443:[2a00:1450:4009:c19::65]"
[8]=>
string(50) "developers.google.com:443:[2a00:1450:4009:c19::8a]"
[9]=>
string(50) "developers.google.com:443:[2a00:1450:4009:c19::71]"
}
array(4) {
["errno"]=>
int(7)
["error"]=>
string(26) "Couldn't connect to server"
["status"]=>
int(0)
["bytes"]=>
int(0)
}