Package: cli53
WARNINGcli53 0.5 (python version) is no longer being actively maintained, to install the latest version see:https://github.com/barnybug/cli53/#installationcli53 - Command line script to administer the Amazon Route 53 DNS serviceIntroductioncli53 provides import and export from BIND format and simple command line management of
Route 53 domains.Features:create hosted zonesdelete hosted zoneslist hosted zonesimport from BIND formatexport to BIND formatcreate resource recordsdelete resource recordsworks with BIND format zone files we all know and love - no need to edit
&lt;ChangeResourceRecordSetsRequest&gt; XML!create AWS weighted recordscreate AWS Alias records to ELBcreate AWS latency-based routing recordsdynamic record creation for EC2 instancesInstallationYou’ll need to install pip if you’ve not installed it already.Ubuntu systems:$ apt-get install python python-pipRedhat systems (eg Amazon Linux):$ yum install python27 python27-pipThen install cli53:$ sudo pip install cli53Or on Redhat/Amazon Linux:$ sudo pip-2.7 install cli53(You may need to add /usr/local/bin to your $PATH)You can then run cli53 from your path:$ cli53You need to set your Amazon credentials in the environment as AWS_ACCESS_KEY_ID
and AWS_SECRET_ACCESS_KEY or configure them in ~/.boto. For more information see:http://code.google.com/p/boto/wiki/BotoConfigGetting StartedCreate a hosted zone:$ cli53 create example.com --comment 'my first zone'Check what we’ve done:$ cli53 listImport a BIND zone file:$ cli53 import example.com --file zonefile.txtReplace with an imported zone, waiting for completion:$ cli53 import example.com --file zonefile.txt --replace --waitManually create some records:$ cli53 rrcreate example.com www A 192.168.0.1 --ttl 3600
$ cli53 rrcreate example.com www A 192.168.0.2 --ttl 3600 --replace
$ cli53 rrcreate example.com '' MX '10 192.168.0.1' '20 192.168.0.2'Export as a BIND zone file (useful for checking):$ cli53 export example.comCreate some weighted records:$ cli53 rrcreate example.com www A 192.168.0.1 --weight 10 --identifier server1
$ cli53 rrcreate example.com www A 192.168.0.2 --weight 20 --identifier server2Create an alias to ELB:$ cli53 rrcreate example.com www ALIAS 'ABCDEFABCDE dns-name.elb.amazonaws.com.'Further documentation is available, e.g.:$ cli53 --help
$ cli53 rrcreate --helpBroken 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
mydomain.com on the end (e.g. ghs.google.com.mydomain.com), then you
need to fix your zone file before importing:$ perl -pe ‘s/(CNAMEs+[-a-zA-Z0-9.-_]+)(?!.)$/$1./i’ broken.txt > fixed.txtDynamic records for EC2 instancesThis functionality allows you to give your EC2 instances memorable DNS names
under your domain. The name will be taken from the ‘Name’ tag on the instance,
if present, and a CNAME record created pointing to the instance’s public DNS
name (ec2-…).In the instance Name tag, you can either use a partial host name ‘app01.prd’ or
‘app01.prd.mydomain.com’ - either creates the correct record.The CNAME will resolve to the external IP address outside EC2 and to the
internal IP address from another instance inside EC2.Another feature supported is whilst an instance is stopped, if you specify the
parameter ‘–off fallback.mydomain.com’ you can have the dns name fallback to
another host. As an example, a holding page could be served up from this
indicating the system is off currently.You can use the ‘–match’ parameter (regular expression) to select a subset of
the instances in the account to apply to.Generally you’ll configure cli53 to run regularly from your crontab like so:*/5 * * * cli53 instances example.comThis runs every 5 minutes to ensure the records are up to date. When there no
changes, this will purely consist of a call to list the domain and the describe
instances API.If the account the EC2 instances are in differs from the account the route53
domain is managed under, you can configure the EC2 credentials in a separate
file and pass the parameter ‘–credentials aws.cfg’ in. The credentials file is
of the format:[profile prd]
aws_access_key_id=...
aws_secret_access_key=...
region=eu-west-1

[profile qa]
aws_access_key_id=...
aws_secret_access_key=...
region=eu-west-1As illustrated above, this also allows you to discover instances from multiple
accounts - for example if you split prd and qa. cli53 will scan all ‘[profile
…]’ sections.Private/public zonesTo 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 127.0.0.1CaveatsAs 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!Changelog0.5.2A note about new version.0.5.1Set EvaluateTargetHealth to ‘true’ when creating failover ALIASesRaise a ValueError when the type of alias is not of the supported onesRestrict the values for the ‘–failover’ argumentAdd retry for convert in which rate limitting can occur.0.5.0Remove ‘xml’ command. Fixes #99Handling throttling gracefully.Fixes to testsHandle Route53 throttling responses while waitingAllow specifying an identifier when delete RRsSupport failover record types (based on work of Lee-Ming Zen)Clarify using Zone ID. Fixes #91.0.4.4instances option (-i) to create internal records (@asmap)instances option (-a) to create A records (@asmap)Making cli53 importable as python module (@aleszoulek)Create DNS records for instances without public addresses (@andrewklau)0.4.3Handle duplicate named instances. Fixes #810.4.2Revert “Support failover record types” ref #790.4.1Support failover record types (thanks @leezen)Optimize comparisons for speed up ‘import –replace’. Thanks to @goekesmi. Fixes #75.add required EvaluateTargetHealth element for Alias records (thanks @fitt)0.4.0Improve loggingAdd dynamic EC2 instance registrationFix exception on unsupported attributesHandle / in zone names for arpa domains. fixes #61.Nicer error messages on invalid zone filespep8/code formatting0.3.6Support for zone comments0.3.5Fix for zero weighted records0.3.3Check boto version0.3.2Added functionality to rrlist, rrcreate, import and export so that
they’re able to work with Alias records that have an identifier and
a latency based or weighted routing policy. (xbe)Improve error message when boto fails to import0.3.1Added support for Latency-based routing. For the moment to use thisyou’ll need the boto develop branch: pip installhttps://github.com/boto/boto/tarball/develop0.3.0Added support for AWS extensions: weighted records and aliased
records.