Retrieving whois raw data

Discussion in 'PHP' started by vicvic, Jun 12, 2008.

  1. #1
    I am working on a site that requires me to pull whois data and parse it afterwards. I have tried many ways and many different whois servers (whois.nsiregistry.net, whois.internic.net, whois.crsnic.net) but I can not get real whois records (domain registrar, created/expired date etc.), all I can get is just some zone information.

    Any help would be appreciated.

    function whois($dn) {
    $fp = fsockopen('whois.nsiregistry.net',43);
    if($fp) {
    fputs($fp, $dn."\r\n");
    while(!feof($fp)) {
    $data .= fread($fp, 1024);
    }
    fclose($fp);
    } else {
    $data = "error";
    }
    return $data;
    }

    echo whois('yahoo.com');
     
    vicvic, Jun 12, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    Have you tried connecting to the registrars whois server to fetch that information?

    Jay
     
    jayshah, Jun 12, 2008 IP