Command line tool for Amazon Route 53
Go Gherkin Makefile
Latest commit e8ba6f4 Feb 15, 2017 @barnybug committed on GitHub Merge pull request #218 from daharon/rpm-spec
Spec file for creating RPM packages.
Failed to load latest commit information.
.github Update Dec 1, 2016
cmd/cli53 Further test coverage Oct 19, 2015
contrib/rpm Spec file for creating RPM packages. Feb 14, 2017
internal/features Lowercase record names to make imports case-insensitive. Fixes #206 Nov 22, 2016
tests Lowercase record names to make imports case-insensitive. Fixes #206 Nov 22, 2016
vendor/ More stale submodules Sep 13, 2016
.gitignore Expand code coverage to include integration tests. Oct 19, 2015
.travis.yml Update travis to go 1.7 Aug 28, 2016 Changelog for 0.8.7 Nov 22, 2016
Dockerfile setup Docker build May 3, 2016
LICENSE Add LICENSE Oct 14, 2015
Makefile Simpler versioning, only strip release exes Sep 10, 2016 Simplify go get instructions Sep 13, 2016
awsrr.go Fix import of routed ALIAS records. Fixes #170 Apr 17, 2016
bind.go Lowercase record names to make imports case-insensitive. Fixes #206 Nov 22, 2016
bind_test.go Fix import of routed ALIAS records. Fixes #170 Apr 17, 2016
commands.go Support stdin (-) for import. Fixes #209 Nov 22, 2016
formatters.go Handle nil Comment Sep 7, 2016
formatters_test.go List -format functionality Sep 7, 2016
glide.lock Update vendor dependencies, fix gucumber Aug 28, 2016
glide.yaml Revert updates to miekg/dns Aug 28, 2016
instances.go Paginate instances listing Nov 17, 2016
lexer.go Initial commit Oct 13, 2015
main.go Changelog for 0.8.7 Nov 22, 2016
util.go Instances command Sep 16, 2016
util_test.go Add tests for shorter zone IDs Sep 15, 2016

Build status Join the chat at

cli53 - Command line tool for Amazon Route 53


cli53 provides import and export from BIND format and simple command line management of Route 53 domains.


  • import and export BIND format

  • create, delete and list hosted zones

  • create, delete and update individual records

  • create AWS extensions: failover, geolocation, latency, weighted and ALIAS records

  • create, delete and use reusable delegation sets


Installation is easy, just download the binary from the github releases page (builds are available for Linux, Mac and Windows):

$ sudo mv cli53-my-platform /usr/local/bin/cli53
$ sudo chmod +x /usr/local/bin/cli53

Alternatively, on Mac you can install it using homebrew

$ brew install cli53

To configure your Amazon credentials, either place them in a file ~/.aws/credentials:

aws_access_key_id = AKID1234567890
aws_secret_access_key = MY-SECRET-KEY

Or set the environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.

You can switch between different sets in the credentials file by passing --profile to any command, or setting the environment variable AWS_PROFILE. For example:

    cli53 list --profile my_profile 

For more information, see:

Building from source

To build yourself from source (you will need golang >= 1.5 installed):

$ go get

This will produce a binary cli53 in $GOPATH/bin, after this follow the steps as above.

Getting Started

Create a hosted zone:

$ cli53 create --comment 'my first zone'

Check what we've done:

$ cli53 list

List also supports other output formats (eg. json for scripting using jq):

$ cli53 list -format json | jq .[].Name

Import a BIND zone file:

$ cli53 import --file zonefile.txt

Replace with an imported zone, waiting for completion:

$ cli53 import --file zonefile.txt --replace --wait

Also you can 'dry-run' import, to check what will happen:

$ cli53 import --file zonefile.txt --replace --wait --dry-run

Create an A record pointed to with TTL of 60 seconds:

$ cli53 rrcreate 'www 60 A'

Update this A record to point to

$ cli53 rrcreate --replace 'www 60 A'

Delete the A record:

$ cli53 rrdelete www A

Create an MX record:

$ cli53 rrcreate '@ MX 10 mail1.' '@ MX 20 mail2.'

Create a round robin A record:

$ cli53 rrcreate '@ A' '@ A'

For CNAME records, relative domains have no trailing dot, but absolute domains should:

$ cli53 rrcreate 'login CNAME www'
$ cli53 rrcreate 'mail CNAME'

Export as a BIND zone file (for backup!):

$ cli53 export

Create some weighted records:

$ cli53 rrcreate --identifier server1 --weight 10 'www A'
$ cli53 rrcreate --identifier server2 --weight 20 'www A'

Create an alias to an ELB:

$ cli53 rrcreate 'www AWS ALIAS A ABCDEFABCDE false'

Create an alias to an A record:

$ cli53 rrcreate 'www AWS ALIAS A server1 $self false'

Create an alias to a CNAME:

$ cli53 rrcreate 'docs AWS ALIAS CNAME mail $self false'

Create some geolocation records:

$ cli53 rrcreate -i Africa --continent-code AF 'geo 300 IN A'
$ cli53 rrcreate -i California --country-code US --subdivision-code CA 'geo 300 IN A'

Create a primary/secondary pair of health checked records:

$ cli53 rrcreate -i Primary --failover PRIMARY --health-check 2e668584-4352-4890-8ffe-6d3644702a1b 'ha 300 IN A'
$ cli53 rrcreate -i Secondary --failover SECONDARY 'ha 300 IN A'

Create, list and then delete a reusable delegation set:

$ cli53 dscreate
$ cli53 dslist
$ cli53 dsdelete NA24DEGBDGB32

Further documentation is available, e.g.:

$ cli53 --help
$ cli53 rrcreate --help

Bug reports

Please open a github issue including cli53 version number cli53 --version and the commands or a zone file to reproduce the issue. A good bug report is much appreciated!

Pull requests

Pull requests are gratefully received, though please do include a test case too.

Where's python/pypi cli53?

I've since rewritten the original python cli53. As people were still installing the old version I've taken it off pypi. If you must, you can still install the python cli53 by giving pip the github branch:

$ pip install git+

Bare in mind I'll no longer be supporting this any more, so any bug reports will be flatly closed!

Broken CNAME exports (GoDaddy)

Some DNS providers export broken bind files, without the trailing '.' on CNAME records. This is a requirement for absolute records (i.e. ones outside of the qualifying domain).

If you see CNAME records being imported to route53 with an extra on the end (e.g., then you need to fix your zone file before importing:

$ perl -pe 's/((CNAME|MX\s+\d+)\s+[-a-zA-Z0-9._]+)(?!.)$/$1./i' broken.txt > fixed.txt

Private/public zones

To manage zones that have both a private and a public zone, you must specify the zone ID instead the domain name, which is ambiguous. This is the 13 character ID after '/hostedzone/' you can see in the output to 'cli53 list'. eg:

$ cli53 rrcreate ZZZZZZZZZZZZZ 'name A'


As Amazon limits operations to a maximum of 100 changes, if you perform a large operation that changes over 100 resource records it will be split. An operation that involves deletes, followed by updates such as an import with --replace will very briefly leave the domain inconsistent. You have been warned!