Migrating DNS to Route 53
A fair proportion of my work these days is to take over the management of pre-existing Magento sites, migrating them to a new Amazon host along the way. It's often the case that you'll need to migrate the DNS NameServers over as well. I've got this in my mindset as a trivial job, an you just put up with a bit of tedious cutting and pasting between GUIs to get the job done.
Then you get a client who's really gone overboard, and you have thousands of entries to migrate. So, after berating yourself for not checking thoroughly enough first, you look to see whether there are any tools around that will help.
And, joy of joys, there are!
Here's how to do it... it's a bit tedious if you aren't already using python.
1. Install setuptools
tar xf setuptools-0.6c11.tar.gz
python setup.py install
2. Install pip
curl -O https://raw.github.com/pypa/pip/master/contrib/get-pip.py
3. Install boto
pip install boto
4. Configure boto. As a basic config, add this to /etc/boto.cfg
debug = 0
num_retries = 10
aws_access_key_id = my_access_key_id
aws_secret_access_key = my_secret_access_key
5. Install cli53
pip install cli53
Now I can install any existing BIND zone file. I found that I needed to add the following line to the top of the file if if didn't exist
Note the final '.' on that line.
Then I could import it straight from theexisting zone file.
cli53 import example.com --file example.com.db
Not only is that great because it automates the migration of the zone, so you can get it off the old server before migration time, but it then allows you to modify the file, so that shortening TTL and updating the zone are much simplified, and the whole process is auditable!