This article contains PHP implementation of whois client (as a function ae_whois), which may be used to request domain information from specified whois servers
Whois protocol (defined by RFC 3912) is probably one of the simplest internet protocols. In fact, whois client should open TCP connection to port 43, send query, send CR-LF ("\r\n" constant) and then receive response. Here is the source code: source code: php <?php As you can see, function takes two arguments: whois query and whois server. Function returns server response (if everything was fine), or 'false' constant(that means connection failed). fsockopen error code and error string are written to global variables $ae_whois_errno and $ae_whois_errstr. You can also change connection timeout by modifying AE_WHOIS_TIMEOUT constant. Usage example: getting information about domain 'iphone.com' source code: php <?php whois.verisign-grs.com is a whois server for .com domains (as of september 2007)
|
|