john pfeiffer
  • Home
  • Categories
  • Tags
  • Archives

Amazon dns route53

amazon-dns-route-53

signup for Amazon DNS service download dnscurl.pl chmod +x dnscurl.pl


Create a the access file /root/.aws-secrets (make sure it doesn't already exist!)

Use the Amazon -> Security Credentials -> Access Credentials

ACCESS KEYS (access key id and secret access key)

%awsSecretAccessKeys = ( "my-aws-account" => { id => "0F1V9UKMN23IEXAMPLE2", key => "lkTwZRalREYSU7lbSS5VoUhdYREcwsasEXAMPLEQ", }, );

chmod 600 .aws-secrets

NOTE: we've just created a variable "my-aws-account" which we'll see again...


Create the "MyCreateRequest.xml" file (replace the Name with your domain, trailing .)

example.com. a_unique_reference Migrate an existing domain to Route 53


The Perl script will POST the xml file with the credentials...

dnscurl.pl --keyname my-aws-account -- -H "Content-Type: text/xml; charset=UTF-8" -X POST --upload-file ./MyCreateRequest.xml https://route53.amazonaws.com/2010-10-01/hostedzone


THE RESPONSE ANSWER (not very pretty xml)

/hostedzone/ZONEIDHEREdomain.net.domain.net_01Migrate domain.net to Route 53/change/ROUTE53NUMSPENDING2011-03-27T05:08:36.770Zns-186.awsdns-23.comns-1460.awsdns-54.orgns-1569.awsdns-04.co.ukns-888.awsdns-47.net

CREATE AN A RECORD (createARecord.xml)

add subdomain.domain.net CREATE subdomain.domain.net. A 14400 192.168.50.46

./dnscurl.pl --keyname my-aws-account -- -H "Content-Type: text/xml; charset=UTF-8" -X POST --upload-file ./createARecord.xml https://route53.amazonaws.com/2010-10-01/hostedzone/YOURZONE_IDHERE/rrset

RETURNS

/change/C3UYPNJ8B1L5F5PENDING2011-03-27T05:26:03.755Z

VERIFY

./dnscurl.pl --keyname my-aws-account -- -H "Content-Type: text/xml; charset=UTF-8" https://route53.amazonaws.com/2010-10-01/hostedzone/ZONE_ID/rrset

dig @ns-1489.awsdns-58.org domain.com www.domain.com


DELETE AN A RECORD (deleteARecord.xml)

Basically to "change" you delete the old record and create a new one

delete subdomain.domain.net DELETE subdomain.domain.net. A 14400 192.168.50.46

./dnscurl.pl --keyname my-aws-account -- -H "Content-Type: text/xml; charset=UTF-8" -X POST --upload-file ./filename.xml https://route53.amazonaws.com/2010-10-01/hostedzone/YOURZONE_IDHERE/rrset

RETURNS

/change/CCK58QR761VWJPENDING2011-03-28T19:33:05.408Z

TROUBLESHOOTING ( 7.15.5 or newer of Curl )

ERROR Can't locate Digest/HMAC_SHA1.pm in @INC (@INC contains: /etc/perl /usr/local/lib/perl/5.10.1 /usr/local/share/perl/5.10.1 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.10 /usr/share/perl/5.10 /usr/local/lib/site_perl .) at ./dnscurl.pl line 26.

sudo apt-get install libdigest-hmac-perl

(SIMILAR - dependency Perl modules, which you can download from CPAN) Digest::HMAC_SHA1 FindBin MIME::Base64 Getopt::Long File::Temp File::Basename Fcntl IO::Handle


FUNNY CREDENTIALS FILE ERROR

Welcome to AWS DNS curl! You'll need to install your AWS credentials to get started.

For security reasons, this tool will not accept your AWS secret access key on the command line. Instead, you need to store them in a file named /root/.aws-secrets.

APPARENTLY AMAZON'S SCRIPT IS PRETTY SPECIFIC ABOUT WHERE IT WANTS THAT FILE...


FURTHER RESEARCH

GET /2010-10-01/hostedzone?maxitems=1


  • « Wget download move directory timestamp variable
  • Backup vm tomcat firewall console »

Published

Mar 28, 2011

Category

virtualization

~308 words

Tags

  • amazon 17
  • dns 6
  • route53 3
  • virtualization 87