= Route53 zone export to BIND =

Amazon Route53 by default does not export BIND format. If you want to do any migration of hosted zones at all, you will have to use the following trick:

1
2
aws route53 list-resource-record-sets --hosted-zone-id Z2LEVEIW95Z4XZ --output json \
    | jq -jr '.ResourceRecordSets[] | "\(.Name) \t\(.TTL) \t\(.Type) \t\(.ResourceRecords[]?.Value)\n"'

This converts this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
{
    "ResourceRecordSets": [
        {
            "Name": "hostedprebid.com.",
            "Type": "NS",
            "TTL": 3600,
            "ResourceRecords": [
                {
                    "Value": "ns-109.awsdns-13.com."
                },
...

To this:

1
2
3
4
adserver.hostedprebid.com. 	1 	CNAME 	org-296-0f667-dmyt03fgsksh5xx.stackpathdns.com
jita.hostedprebid.com. 	60 	CNAME 	generic-jita-dmyt03fgsksh5xx.stackpathdns.com
vcache.hostedprebid.com. 	60 	CNAME 	vcache-dmyt03fgsksh5xx.stackpathdns.com
...

= References =

  • Nothing here.