Question: 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!

Answer: 
`whois.denic.de` requires `-T dn` to be prepended before your request.

E.g.:

```
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "-T dn $domain\r\n"); // Query

```
Are you in linux or windows? If in linux just execute: 

```
system('whois google.de');

```