Python Interface to Route53

pip install slick53==0.91



A python interface for AWS Route53.


Run these commands to install:

git clone git://
cd slick53
sudo python install

You also need to set the following environment variables:

export AWS_ACCESS_KEY_ID="<Insert your AWS Access Key>"
export AWS_SECRET_ACCESS_KEY="<Insert your AWS Secret Key>"


I wrote this library to make dealing with Amazon's Route53 DNS service a lot easier. Now you can write code like the following:

>>> from slick53 import route53
>>> zone = route53.create_zone('')                 # Creates the zone,
>>> zone.add_a('', '')                # Adds A record to the zone.
>>> zone.add_cname('', '')          # Adds CNAME record to the zone.
>>> zone.add_mx(['10', '20']) # Adds MX records to the zone.

Now what just happended. On line two we create the zone. Then we create an A record for the naked domain, followed by a cname for the ‘www’ subdomain which points back to the naked domain. Then we also added two MX records for our mail exchangers. Also, you don’t need to worry about trailing dots and fully qualified domain names, because that is handled automatically.

Now, we can grab a list of all zones like this:

>>>  route53.get_zones() # Get all hosted zones.
[<>, <>]

Or we can grab our individual zone by name:

>>> zone = route53.get_zone('')

You can also look at what records you have in your zone:

>>> for record in zone.get_records():
...     print record
<[u'10', u'20']>
<[u'', u'']>
<[u' 1 7200 900 1209600 86400']>

And here is how you grab just the nameservers for your zone:

>>> zone.get_nameservers() # Get nameservers for the zone.
[u'', u'']

You add the nameservers to your domain registrar to actually switch to Amazon’s DNS service. I would recommend migrating a non-critical domain to start to make sure that you understand the process before moving your big domain with hundreds of records over to Route53.

Now we can remove all these records and the zone itself like so:

>>> zone = route53.get_zone('') # Get the zone.
>>> zone.delete_a('')           # Delete A record from the zone.
>>> zone.delete_cname('')   # Delete CNAME record from the zone.
>>> zone.delete_mx()                       # Delete MX records from the zone.
>>> zone.delete()                          # Delete the zone itself.

If anyone has any questions, bugs or issues then feel free to ask.
Hopefully, this will make your life with Route53 significantly easier.


boto - must have at least version 2.0