Back in August 2006 I wrote a review on EveryDNS. 2 and half years later nothing much has changed — same interface and same functionality, and it is still serving many of my domains. One thing I don’t like about EveryDNS is its lack of API support, i.e. you cannot programatically update your records. This is especially getting inconvenient when I moved my main emails to Google Apps in January, and moved my currently-unused domains to Google AdSense for domains last week. Hand copying and pasting a big list of records for each domain is just too much work!

So, like any lazy-programmers who do not wish to spend 2 minutes solving a borning problem, I simply spent 2 hours coding up an EveryDNS client API library for Python, so I can add/remove domains/records programatically. This is inspired by the EveryDNS PHP API. It basically scrapes EveryDNS’s web interface.

Downloads

If you just want the library, there’s only a single PY file to download.

Just put it somewhere in your PYTHONPATH. It is developed on Python 2.5 and sorry no guarantee that it will work on any other Python version :)

Usage

Some sample usage of this library:

$ python
Python 2.5.2 (r252:60911, Dec 12 2008, 10:25:58)
Type "help", "copyright", "credits" or "license" for more information.
>>> import everydnslib
>>> edns = everydnslib.EveryDNS(username, password)
>>> edns.list_domains()
[{'did': '...', 'domain': 'example.com', 'type': 'primary'},
 {'did': '...', 'domain': 'foobar.com', 'type': 'primary'},
 ...
 {'did': '...', 'domain': 'testing1.com', 'type': 'webhop', 'webhop': 'http://testing2.com/'}]
>>> edns.list_records('example.com')
[{'rid': '...', 'host': 'example.com', 'type': 'A', 'value': '123.123.123.123', 'mx': '', 'ttl': '43200'},
 {'rid': '...', 'host': 'example.com', 'type': 'MX', 'value': 'mx.example.com', 'mx': '1', 'ttl': '43200'},
 ...
 {'rid': '...', 'host': 'www.example.com', 'type': 'CNAME', 'value': 'example.com', 'mx': '', 'ttl': '7200'}]
>>> edns.add_domain('example2.com')
>>> edns.add_record('example2.com', 'www.example2.com', 'A', '123.123.123.123')
>>> edns.del_records('example.com', rtype='MX')
>>> edns.del_domain('example.com')

I have also added some helper functions to set up Google-related services.

$ python
Python 2.5.2 (r252:60911, Dec 12 2008, 10:25:58)
Type "help", "copyright", "credits" or "license" for more information.
>>> import everydnslib
>>> edns = everydnslib.EveryDNS(username, password)
>>> everydnslib.setup_gmail(edns, 'example.com')
>>> everydnslib.setup_adsense_for_domain(edns, 'example.com', 'pub-1234567890')

Unfortunately EveryDNS still does not have SRV record support so it is impossible to get Google Talk to work on your domain.

Command Shell

As a test case for the API, I have also created a simple shell to access domains/records on your EveryDNS account. Download the following PY file:

Put the file in the same directory as everydnslib.py. chmod it to executable, and then run it.

$ ./everydnscmd.py username password
[username@everydns] ls
TYPE       DOMAIN
primary   example.com
primary   foobar.org
...
webhop    testing1.com
[username@everydns] ls example.com
           HOST TYPE  VALUE             TTL     MX
    example.com A     123.123.123.123 43200
    example.com MX    mx.example.com  43200      1
...
www.example.com CNAME example.com      7200
[username@everydns] add example2.com
[username@everydns] add example2.com www.example2.com A 123.123.123.123
[username@everydns] del example.com example.com MX
[username@everydns] del example.com
[username@everydns] help

Documented commands (type help ):
========================================
add  del  ls

Undocumented commands:
======================
EOF  exit  help

That’s it!

Hopefully Python coders who use EveryDNS will find this module useful.

Updates 20 June 2009

Thanks to Brian Hartvigsen from EveryDNS for sending me a patch including the following updates:

  • Allows listing, adding, deleting dynamic domain’s records
  • Remove code that duplicates functionality in the backend
  • Fixed regex for domains that are marked as not listing our nameservers
    Nothing in Python API indicates this status currently, but this could be added
  • Updated for forthcoming updates. Compatible w/ existing site too
  • Webhops had domain/webhop reversed

While this is not an EveryDNS officially supported API, they are trying not to break it so big thanks to them for providing me updates.

Again, the files are hosted on a Subversion server. If you would to send me patches, do

$ svn checkout http://svn.fucoder.com/fucoder/pyeverydns/
$ ...
$ svn diff > unified.diff

And feel free to send that diff to me.