title: PHP - DENIC whois query with cURL doesn't work well
body: <p>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.</p>
  
  <p>Here's the code:</p>
  
  <pre><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 "&lt;br/&gt;";
  echo curl_errno ($ch);
  echo "&lt;br/&gt;";
  </code></pre>
  
  <p>Here's the fsockopen query:</p>
  
  <pre><code>fsockopen($whois_server,43, $errno, $error, 5);
  </code></pre>
  
  <p>Has anyone an idea what could be wrong? Thanks!</p>