HomePHP Page 4 - Using PHP classes to navigate distributed whois databases
Overview of Whois2.php - PHP
Whois services changed radically this year with the introductionof competition at the registrar level in the .com/.net/.orgnamespace and with it the advent of the SRS (Shared Registry System). Find out how to navigate the new whois in your PHP scripts.
This package is a lot different from it's precursor whois.php3, which was a single class that had to be tweaked and hacked everytime somethingchanged. Whois2.php is designed in a way that if one registrar somewherechanges their output format (something NetSol does often enough), theentire class won't break.
When all is said and done, we can use this class to do whois lookupsfor 121 TLDs, including the gTLD's .com/.net/.org/.edu/.int/.mil,the ccTLD's like .ca, .il, .at etc., Nominet's 2LD domains uk.com,gb.com and gb.net, and the ORSC (Open Root Server Consortium) alternatestaging roots (.web, .info, .shop, etc).
At the very least we can get back simple output from the whois server itselfin raw, unparsed form. In better cases we have extended methods to furtherprocess the raw result into nice key/value pairs, and in the case ofdomains registered in .com/.net/.org we can seperate parsed results intoboth those of the registry server response and then the correspondingregistrar's server output, provided we have the methods available to parse it.
If the methods do not exist to further process data, the class returnswhat it has. If you want to create your own extended class to providemethods to parse the raw output of a given TLD, it's very simpleto add it to the mix.