|
NAMEroute53 - Manage your DNS entries on Amazon's Route53 service DESCRIPTIONroute53 will manage your Amazon Route 53 account SYNOPSISroute53 {key and id} [options] action [action arguments] Either "-keyfile" and "-keyname" or "-id" and "-key" must be provided. OPTIONS
ARGUMENTSroute53 performs a number of actions, each of which may take a number of arguments:
EXAMPLESSpecify your credentialsYou need to specify your credentials with one of the following notations. All the examples below use the "--keyname" notation, defaulting to using the "~/.aws-secrets" file. # Uses ~/.aws-secrets as repository, key name is specified
$ route53 --keyname my-aws-keyname
# Uses the given key file and key name
$ route53 --keyfile ~/.aws --keyname my-aws-keyname
# Uses the given key and id
$ route53 --key ABCDE --id DEFG
List your zonesLists the zones names, ids and comments: $ route53 --keyname my-aws-account list
Hosted zone:
id: /hostedzone/ABCDEFG
name: example.com.
callerreference: FGHIJK
comment: Zone for example.com.
Hosted zone:
id: /hostedzone/FGHJKL
name: anotherexample.com.
callerreference: QWERTY
comment: Zone for anotherexample.com.
Get all nameservers (and details) for all zonesDisplays a verbose list of the zone details and the nameservers which are authoritative for the zone: $ route53 --keyname my-aws-account nameservers
Hosted zone:
id: /hostedzone/ABCDEFG
name: example.com.
callerreference: FGHIJK
comment: Zone for example.com.
nameserver: ns-123.awsdns-123.com
nameserver: ns-123.awsdns-123.co.uk
nameserver: ns-123.awsdns-123.org
Hosted zone:
id: /hostedzone/FGHJKL
name: anotherexample.com.
callerreference: QWERTY
comment: Zone for anotherexample.com.
nameserver: ns-456.awsdns-456.com
nameserver: ns-456.awsdns-456.co.uk
nameserver: ns-456.awsdns-456.org
Get just the nameservers for a specific zoneDisplays a terse list of the nameservers, one per line: $ route53 --keyname my-aws-account nameservers example.com.
ns-123.awsdns-123.com
ns-123.awsdns-123.co.uk
ns-123.awsdns-123.org
This allows the nameservers to be used in scripting: $ for nameserver in
$( route53 --keyname my-aws-account nameservers example.com. );
do
# do whatever you want with $nameserver
done;
Create a new zoneCreates a new zone: $ route53 --keyname my-aws-account zone create example.com. \
--comment 'Zone for example.com.'
--callerreference 'unique id for this'
You can optionally specify "--wait" to wait for the zone to have been effectively created. Otherwise the command returns as soon as the request has been sent to Route 53. Delete a zoneDeletes a zone (assuming the zone contains only "SOA" and "NS" records): $ route53 --keyname my-aws-account zone delete example.com. You can optionally specify "--wait" to wait for the zone to have been effectively deleted. Otherwise the command returns as soon as the request has been sent to Route 53. List all DNS records for a zoneLists all DNS records for a zone: $ route53 --keyname my-aws-account record list example.com.
example.com. A 14400 127.0.0.1
example.com. MX 14400 127.0.0.1
example.com. NS 172800 ns-123.awsdns-123.com. ns-123.awsdns-123.co.uk. ns-123.awsdns-123.org.
example.com. SOA 900 ns-123.awsdns-123.com. awsdns-hostmaster.amazon.com. 1 7200 900 1209600 86400
\052.example.com. A 300 127.0.0.1
You can optionally specify "--type" to display only DNS records of a given type: $ route53 --keyname my-aws-account record list example.com. --type A
example.com. A 14400 127.0.0.1
\052.example.com. A 300 127.0.0.1
Delete a specific DNS record for a zoneThis example assumes we want to remove the "\052.example.com." entry. One can check which parameters are needed to get the correct entry with the "record list" first: $ route53 --keyname my-aws-account record list example.com. --type A
example.com. A 14400 127.0.0.1
\052.example.com. A 300 127.0.0.1
$ route53 --keyname my-aws-account record list example.com. --type A --ttl 300
\052.example.com. A 300 127.0.0.1
Or can read the error message given in case there are too many matching records: $ route53 --keyname my-aws-account record delete example.com. --type A
Too many records match:
example.com. A 14400 127.0.0.1
\052.example.com. A 300 127.0.0.1
The lone record deletion: $ route53 --keyname my-aws-account record delete example.com. --type A --ttl 300 Create a new DNS record for the zoneThis adds a new record for the zone: $ route53 --keyname my-aws-account record create example.com. \
--name test.example.com. --type A --ttl 300 \
--value 127.0.0.1
AUTHORMarco FONTANI <mfontani@cpan.org> COPYRIGHT AND LICENSEThis software is copyright (c) 2011 by Marco FONTANI. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
|