{ Hi! I'm Mike }
I'm a core developer with The Horde Project and a founding parter of Horde LLC - the company behind the world's most flexible groupware platform. This is my personal blog full of random thoughts about development and life in general.
December 22, 2007

phpEnomUpdate - A small command line utility.

¬≠Like many of us, I own a number of domain names.  I also have two servers that run out of my home in addition to a production VPS server located on the other side of the country from where I am. The domain registrar I use provides a 'normal' DNS service combined with a dynamic service that allows you to define any host on your domain as dynamic.  This has worked out well for me, allowing me to integrate my various home machines onto my domain. 

Recently (thanks to a server replacement project - but that's another story) I had to rebuild my main development server and in the process I decided I wanted name based virtual hosting on this box as well.  This presented a problem, as I have a number of domains that would need to be supported on this box. The protocol my provider uses for dynamic DNS updates allows any number of hosts on a domain to be updated at one time, but not mulitple domains (obviously).  I could have either updated the client that I was using (some really rough Perl script), find a better client, or write my own.

The enomupdate script was a poorly written tool that served a basic purpose. Update one domain. Period.  You couldn't even run it with different paramers or configuration files.  I could have modified it, but I'm not as comfortable in Perl as I am in PHP and I thought it a good way to emphisize the fact that PHP is not just a web server language.

The result was phpEnomUpdate.  You specify any number of domains (or zones in DNS-speak) each or which can have any number of hosts.  Each host will be updated to your IP. Now, I can have dev.example.com  dev.anotherexample.com  all point to my dynamic IP with one simple cron entry....and now I can keep my lighttpd server directory nice and neat on my dev box too, with simple name based virtual hosting.

 The script does have a few PEAR requirements and one Horde package (Horde_CLI), but they are very easy to install if they are not already on your system. See the INSTALL file in the download for more information.