whois-api-client

This is a simple whois client, with registrar API support, that can be run from any web server to obtain domain details. You can also use this from various Domain Name Management Products available from DomainPunch.Com.

This is very useful in cases when you want to manage your own domain names, but can't access the port 43 whois data because of limitations set by the registrar.

The API will work only for domains registered under your authenticated profile of the supported registrars. In other cases the script will fall back to the default port 43 whois.

Cloud Server Tools for Domain Management

This is the first in a series of cloud server tools for domain name search and management through registrar APIs. We plan to support a large number of registrars.

API Support

The Whois API Client script currently supports the following registrar APIs.

  1. GoDaddy
  2. ResellerClub
  3. Dynadot
  4. DomainsDe
  5. NameCheap
  6. Internetbs

We will add more registrar APIs soon.

Before you start, you will need to obtain the various API keys and configure the IP addresses that will connect to the API. You can do this from your registrar's web interface.

Requirements

Web Server, PHP 5.4 and above with Curl

Installation

  • Download the ZIP file (apiwhois.zip) and unzip into a folder. Copy the

    whois/config-sample.php

    file to config.php in the same folder and open it any text editor. Add the various API keys obtained from your registrar.
  • Upload the entire contents to a web folder.
  • Access the script from a browser like so...

    https://yourdomain/path/web-api-client.php?d=example.com

    and check that it works.
  • Use it to lookup the domains you have registered at one of the API supported registrars. You can do this by specifying the default whois server for that registrar. For example,

    https://yourdomain/path/web-api-client.php?d=godaddy.com&s=whois.godaddy.com

    This will work only if the domain is registered at GoDaddy under your profile. If not, it will fall back to the default port 43 lookup.

Add API Keys

Simple Authentication

You can enable a simple authentication to prevent unauthorized access to your script by adding a key in the config.php file.

For example, you can set

$api_whois_access_key = "bnRtwe78";

and then access the URL as

https://yourdomain/path/web-api-client.php?d=godaddy.com&s=whois.godaddy.com&k=bnRtwe78

Please use the script on an SSL enabled site if you are using a key.

Using the API Script in DomainPunch.Com products

Once everything is working fine you can enable the proxy settings in Domain Punch Pro or Watch My Domains by specifying the URL. This can be done in the 'App Settings' or for individual registrars.

If you are setting it up in the 'App Settings', please see here

You should specify the 'API Web Client URL' entry as

https://yourdomain/path/web-api-client.php

or

https://yourdomain/path/web-api-client.php?k=xxxxx

where xxxxx is your authentication key.

Add API URL in Domain Punch

Using Registrar API only for specific Registrars

If you are using it for individual whois servers, you can specify the URL as the http proxy entry in Whois Setup. You will also have to add the 's' parameter.

For example, for whois.godaddy.com, the proxy URL will be

https://yourdomain/path/web-api-client.php?d={D}&s=whois.godaddy.com

The application (Domain Punch Pro / Watch My Domains) will replace the {D} with the actual domain name when the URL is invoked.

You can also use s=GoDaddy, as in

https://yourdomain/path/web-api-client.php?d={D}&s=GoDaddy

Here are the s values you can use...

  • Resellerclub
  • Godaddy
  • Dynadot
  • Namecheap
  • DomainersDe
  • Internetbs

It is better to use the whois server as the 's' parameter, when it is supported, because the script will be able to default to the normal port 43 whois if the registrar API call fails for any reason. So for GoDaddy (whois.godaddy.com), ResellerClub (whois.publicdomainregistry.com) and Dynadot (whois.dynadot.com) use the whois server instead of the tokens above.

Please see the KB articles at DomainPunch.Com for more details.