A PHP library to retrieve WHOIS informations

    This post is part of the ”WHOIS in PHP: consuming the Robowhois API” series; here is a list of all the articles contained this series:

  1. A PHP library to retrieve WHOIS informations
  2. Retrieving raw WHOIS informations in PHP
  3. Checking a domain’s availability with PHP
  4. Y U NO access WHOIS informations in PHP?

In this days me and my friend David are renewing our committment to open source: our next project is going to be an SDK for a WHOIS webservice.

Last week we got in touch with Simone, the mind behind Robodomain, a startup delivering a really useful product, which lets you

Keep track of all your domains in one place.
Check domain status, log transactions, orders and payments, store notes and enjoy our network tools.

To be able to develop its own software (in Ruby) he started writing a Gem and then realized that this kind of stuff could be useful to other people too: he decided to open a public API – you only need to pay a bunch of bucks to use it – and launch a new, free, universal WHOIS service that everyone can enjoy.

We are taking the stage in order to develop the official PHP SDK for the webservice, so – along with the development of Orient – you’ll read here about this new library in the next weeks.

We have just kickstarted the project, designed the first interfaces, implemented a bunch of methods and tested them: if you are courious enough you can spot them over the internet, but I won’t link and share what we developed until our next DevMeeting, in which we will do the majority of the work.

However I want you to enjoy a preview of what you will be able to do with it (just some explanatory LOCs):

This is definitely NOT gonna be the code you’ll be using, just an example of how things work now
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

use Robowhois\Robowhois;
use Robowhois\Http\Client;
use Buzz\Browser;

$robowhois = new Robowhois($apiKey, new Client(new Browser()));

if ($robowhois->isAvailable("google.com")) {
  echo "Hey man, go register google.com, seems that it's free!";
} else {
  $whois = $robodomain->whoisProperties('google.com');

  echo "Man, you'll need to wait until " . $whois->expiresAt()->format('Y-m-d H:i:s');
  // $whois->expiresAt() returns a \DateTime object
}

As far as we’ve already done, this SDK uses Symfony2’s HttpFoundation and Buzz to properly handle communication with the webservice through the HTTP protocol: we are open to any suggestion, so if you know a very good HTTP client that could replace Buzz1 we would be very glad to evaluate it.

The standard bootstrap of the library will be also using Symfony2’s dependency injection container.

Notes
  1. Not Zend\Http\Client

Hi there! I recently wrote an ebook on web application security, currently sold on leanpub, the Amazon Kindle store and gumroad.

It contains 160+ pages of content dedicated to securing web applications and improving your security awareness when building web apps, with chapters ranging from explaining how to secure HTTP cookies with the right flags to understanding why it is important to consider joining a bug bounty program.

Feel free to skim through some of the free chapters published on this blog and, if the content seems interesting enough to you, grab a copy on leanpub, the Amazon Kindle store, gumroad or simply checkout right down below!

Buy the Web Application Security ebook for $9.99

In the mood for some more reading?

...or check the archives.