Home arrow PHP arrow Page 3 - Using PHP classes to navigate distributed whois databases

Making sense of it with PHP classes - 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.

  1. Using PHP classes to navigate distributed whois databases
  2. Overview of the whois landscape
  3. Making sense of it with PHP classes
  4. Overview of Whois2.php
  5. Looking at the pieces
  6. Tying it all together
  7. Conclusion
By: Mark Jeftovic
Rating: starstarstarstarstar / 11
December 07, 1999

print this article



Enter Whois2.php, a collection of PHP classes designed to take theguesswork out of all this and provide tools to the webmaster to lookup and process domain name data without having to worry aboutwhere to get it.


The class will be used primarily for querying domain names. While otherquery types exist on some servers, notably contact and host recordson the Network Solutions' server, most simply support domain name lookups.If we want to do another query type, we'll see that the class still provides us with methods of doing so.

Web whois databases are not supported. If a given TLD's registry doesn'toperate a whois server on port 43, it doesn't belong in this class. .TOand .FM for example, only offer whois lookups through a web interface,and as such, there is no method to lookup .to or .fm domains here.



We want to make the class as portable as possible across as much of the namespace as possible. This means we want to create a class in which we don't have to do anything different in our code to lookup a domainwhether it's .com or .cz. Of course due to the differences in outputwe may have to handle those results differently, but getting thedata back from a query should be transparent regardless of what thequery is.


We want to be able to break tasks down to smaller, managable sub-tasks.And if part of our landscape changes (i.e. the address of a whois serverchanges, or the output of one is different) we want first, that the changedoesn't affect the rest of our operations and second, that it's as easy aspossible to revise our class to cope with it.

object oriented

We are lazy, and we don't want to code anything twice, so in breakingdown our code into seperate modules for different tasks, those modulesshould inherit anything they need to know that other modules also needto know from a common parent. The parent or base class should be ableto hand off data to other handlers in a seemless, generic way.

>>> More PHP Articles          >>> More By Mark Jeftovic

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort


- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates


Dev Shed Tutorial Topics: