由于cloudflare本年年终大礼导致大量网站无法正常访问,其主面板也出现故障无法正常打开,多数网站出现IPV6错误。域名无法正常解析到正确的主服务器IP。
可能持续时间会较长,且影响很大,那么如何解决再次出现此种情况?
关闭IPV6支持,关掉cloudflare的IPV6支持!
如何关掉?
默认情况下无法正常关掉,后台管理面板上无法关闭它,只能通过说明文档所示关闭
https://developers.cloudflare.com/api/operations/zone-settings-change-i-pv6-setting
完整PHP关闭代码
<? $AuthEmail="emmail"; $AuthKey=""; $zonesid=""; $a=ipv6_record($zonesid,$AuthKey,$AuthEmail); function ipv6_record($zonesid,$AuthKey,$AuthEmail){ $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.cloudflare.com/client/v4/zones/$zonesid/settings/ipv6", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "PATCH", CURLOPT_POSTFIELDS => "{\n \"value\": \"off\"\n}", CURLOPT_HTTPHEADER => [ "Content-Type: application/json", "X-Auth-Email:$AuthEmail", "X-Auth-Key:$AuthKey" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { return false; } else { return $response; } }
运行一次,然后用以下代码进行相关检查:
<? $AuthEmail=""; $AuthKey=""; $zonesid=""; $curl = curl_init(); curl_setopt_array($curl, [ CURLOPT_URL => "https://api.cloudflare.com/client/v4/zones/$zonesid/settings/ipv6", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 30, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Content-Type: application/json", "X-Auth-Email:$AuthEmail", "X-Auth-Key:$AuthKey" ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); var_dump ($response);
转载请注明:无趣的人生也产生有意思的事件 » cloudflare圣诞节对大量网站的礼物:DNS强制解析为IPV6,大量网站无法访问