Question

I am currently trying to connect to nominets whois service via fsockopen but I'm having a problem reading the reply.

code used:

$fp = fsockopen("whois.nic.uk", 43, $errno, $errstr);

if (!$fp) {
    echo "ERROR: $errno - $errstr<br />\n";
} else {
echo "<h1>Connected To The WHOIS Server.</h1>\n\n";
}


fwrite($fp, "madeupdomain.co.uk\r\n");
$lookup = fread($fp, 4096);
fclose($fp);


echo $lookup;

Now I succesfully connect to the WHOIS server and receive a reply but it always misses the end off.

Domain name: madeupdomain.co.uk Registrant: Made Up Inc. Registrant type: Unknown Registrant's address: 123 Fake Road City UK Registrar: Made Up. t/a Madeup[Tag = MADEUP] URL: http://www.madeupadomain.com Relevant dates: Registered on: 14-Feb-1955 Renewal date: 11-Feb-2016 Last updated: 11-Feb-2001 Registration status: Registered until renewal date. Name servers: ns1.madeupnamesrver.com ns2.madeupnamesrver.com ns3.madeupnamesrver.com ns4.madeupnamesrver.com WHOIS lookup made at 00:00:00 07-Dec-2011 -- This WHOIS information is provided for free by Nominet UK the central registry for .uk domain names. This information and the .uk WHOIS are: Copyright Nominet UK 1996 - 2011. You may not access the .uk WHOIS or use any data from it except as permitted by the terms of use available in full at http://www.nominet.org.uk/whois, which includes restrictions on: (A) use of the data for advertising, or its repackaging, recompilation, redistribut

As you can see it's missing the last part of a true whois lookup, this always happens but the position where it is cut off changes depending on what domain I query.

Does anyone have any suggestions?

Thanks.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top