Archive for the ‘editdns.pl’ Category

WebService::EditDNS – Perl interface to EditDNS API

Monday, July 26th, 2010

I have created a simple Perl module that talks to EditDNS API, allowing for easy manipulation of domains/records hosted at EditDNS from within Perl programs. A while ago, I developed a command-line utility that serves a similar purpose, named editdns.pl. The module is sort of an extension of that idea, although it works in a different manner — while editdns.pl impersonates a web browser to access the EditDNS control center website and uses hacky HTML scraping techniques, the module plays it nice and only uses elegant API calls.

The module is called WebService::EditDNS, and is available for download at CPAN. Eventually, it will probably also get a project homepage here on my website (some day in the not-too-distant future).

Editdns.pl – EditDNS Record Management Script

Tuesday, March 31st, 2009

Over the last couple of years, I’ve used a few more or less popular free DNS hosting services, and my best experience so far has been with EditDNS.net — mostly because their service really puts you in control of your domains and records. I started using them when I needed to set up SPF records (which are technically TXT records in a specific format) for a domain, and I discovered TXT records were not supported by most DNS hosting services — EditDNS being one of the few exceptions.

However, a couple days ago I encountered a problem. I wanted to set up a round robin DNS configuration for a domain with two IP addresses, one of them being a dynamic IP (that changed once every month or two). One of the key objectives was that the DNS records should be updated automatically when the IP changed. An obvious solution would be to use DynDNS records (supported by EditDNS), but I quickly learned that it’s not possible to set up two records with the same name (which is the basis for a round robin configuration) and make only one of them DynDNS ready. The system considered both records dynamic and wouldn’t just update one, keeping the other one intact. So, bummer. My next idea was to use the EditDNS API to simply delete the old record and create a new one with the new IP address, but this turned out to be impossible too, as the delete function is not yet implemented in the API. Bummer again.

But there are no unsolvable problems, just unwritten Perl scripts. I ended up putting together a simple script that uses LWP::UserAgent to log in to the EditDNS website and add new records or delete existing ones. The script is flexible enough for general use, so I’m making it available — if any fellow EditDNS users are reading this, maybe you’ll find it useful too.