PHP libraries for Dynect API and Namecheap API
At work we currently use GoDaddy to register domains. We register rather a lot of domains. Using GoDaddy makes this take considerably longer than it should. Owen has a good description of the problems with GoDaddy if you’re unfamiliar with the problems with GoDaddy.
I’ve been researching alternatives, with a particular interest in registrars that provide a decent API. I’ve found a couple on my own, and had a few others recommended to me. I’ve focused most of my efforts on Namecheap, who do provide a reasonably complete API.
In addition to a good registrar, I’m also evaluating whether it makes sense to decouple our DNS management from the organization used to register the domains. Namecheap’s bread and butter is registering domains, and their DNS management is a complimentary add-on. You know what they say about getting what you pay for … To that end, I’ve been evaluating Dyn and their Dynect enterprise platform. They offer a very robust API, and provide a number of attractive (and, arguably, pricey) add-on features like GSLB, Active Failover, and more.
As an aside, I’d like to state unequivocally that Dyn’s support staff has been nothing short of phenomenal thus far, and I’m not even a paying customer yet. Ryan O’Hara was super responsive via Twitter. The “concierge” staff (what Dyn calls their tech support folks) have been extremely helpful and technically competent in every exchange I’ve had with them.
Both Namecheap and Dyn offer perfectly serviceable, no-nonsense web interfaces. But there’s still an awful lot of repetition required to complete the setup of the domains we would register. By providing access to an API, though, these companies allow us to create our own internal semi-automated solutions.
The only programming language with which I have any fluency is PHP. Unfortunately for me, I found no existing PHP library for interfacing with the Namecheap API. There is a PHP library for Dynect, but it’s built atop the CodeIgniter framework, and I was underwhelmed with it. So I did what any good open source advocate would do: I wrote my own and published them on github!
My Namecheap REST PHP library is a simple, single class for accessing the Namecheap API. It’s woefully incomplete, but it provides the core functionality I currently need to deploy a proof-of-concept automation solution for my employer.
My Dynect REST PHP library is also a simple, single class for accessing the Dynect API. It, too, is woefully incomplete but it does what I currently need it to do.
I’ve licensed both libraries under the Apache License, so you should feel free to use them. As always, patches are warmly welcomed.
This is my first foray into github, too, so this entire process has been filled with learning opportunities. It’s been fun, and I’m looking forward to demonstrating to my employer the proof-of-concept system I’ve developed atop these two libraries.