Net_Whois lets you query a internet name directory service in a easy to use manner. WHOIS is a protocol which is widely used to determine the owner of a domain name, an IP address by querying an official name database. One possible application I can think of is to see if DNS servers are set correctly for various domains I handle regularly.
Net_Whois being a Pear package we will use the Pear installer as below. I recommend to always use the Pear installer to download packages rather than downloading it manually as the Pear installer automatically downloads any dependent packages.
pear install Net_Whois-1.0.2
The current library uses the following servers to execute the query:
A example code is shown below.
<?php require_once "Net/Whois.php"; $whois = new Net_Whois(); /* You can add other NIC server as a second parameter. */ $info = $whois->query('example.com'); echo($info); ?>
Note that the class returns a string, so you would need to use regular expressions to get to the relevant information.