When I check the avability of a .de-domain with fsockopen it delivers always a result, but when do the same with cURL around 75% of the queries fail. curl_errno then delivers error-code 56 (CURLE_RECV_ERROR). When I try to check .com-domain with whois.crsnic.net then cURL works fine, everytime. Only whois.denic.de makes trouble.
Here's the code:
$domain = "google.de";
$whois_server = "whois.denic.de";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $whois_server.":43"); // Whois Server
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $domain."\r\n"); // Query
$whois = curl_exec ($ch);
echo "RESULT: ".$whois;
echo "<br/>";
echo curl_errno ($ch);
echo "<br/>";
Here's the fsockopen query:
fsockopen($whois_server,43, $errno, $error, 5);
Has anyone an idea what could be wrong? Thanks!