Net_Whois::query() – does a whois query


require_once 'Net/Whois.php';

string Net_Whois::query ( string $query , string $server )


Executes a Whois query on a server


  • string $query - the Whois database object to look up

  • string $server - the name of the server or its IP address

Return value

string - the data from the Whois request.


Possible PEAR_Error values
Error code Error message Reason Solution
every " Error connecting to server (Net_Socket says: Error-Message.) " Connection to server failed Check typing of server address and make sure the host is connected to the network.

You will not get a PEAR_Error, if the query fails due to a not existing whois object. This can be only done by checking the data returned by query().


Using Whois-query()

require_once "Net/Whois.php";

$server "";
$query  "";     // get information about
                               // this domain
$whois = new Net_Whois;
$data $whois->query($query$server);
Net_Whois (Previous) Net_WebFinger (Next)
Last updated: Thu, 26 Nov 2015 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report or add a note.
View this page in:

User Notes:

There are no user contributed notes for this page.