-
AWS Route53 is the only service with 100% SLA.
-
Amazon Registrar does domain registration only for .com, .org, .net domains, the rest are registered via Gandi SAS
aws route53 list-hosted-zones
If you are using configuration profiles:
aws route53 list-hosted-zones --profile <profile-name>
This command returns zone-id you will need in future queries.
aws route53 list-resource-record-sets --hosted-zone-id Z3HR6JS50CWURT
Show all and only A records from a zone:
aws route53 list-resource-record-sets --hosted-zone-id ZN36CWKHEDURT \ --query "ResourceRecordSets[?Type == 'A'] "
Show only records matching the given record value (here www.yurisk.info):
aws route53 list-resource-record-sets --hosted-zone-id ZN36CWKHEDURT \ --query "ResourceRecordSets[?Name == 'www.yurisk.info.'] "
Note
|
AWS returns maximum 100 items in one response. Use paging with NextToken
if you expect to get more results.
|
Create a new public zone named example334455.com:
aws route53 create-hosted-zone --name example334455.com \ --caller-reference some-text-for-me-for-reference
On success returns zone’s ID, request status (e.g. Pending
), allocated name
servers. The caller-reference
you set is used for identifying this request in
logs etc. and can be arbitrary string.
While mainly expected to store the record in JSON format in a local file, we
can specify the record(s) to add explicitly with --change-batch
. Let’s add A
record www.example334455.com wtih TTL of 600, pointing to IP 1.2.3.4:
aws route53 change-resource-record-sets --hosted-zone-id Z0967968IADGHN5TI3WW \ --change-batch ' { "Comment": "Adding A record", "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "www.example334455.com", "Type": "A", "TTL": 600, "ResourceRecords": [ { "Value": "1.2.3.4" } ] } } ] } '
Let’s delete the A record just created www.example334455.com (we use
Action:DELETE
):
aws route53 change-resource-record-sets --hosted-zone-id Z0967968IADGHN5TI3WW \ --change-batch ' { "Comment": "Adding A record", "Changes": [ { "Action": "DELETE", "ResourceRecordSet": { "Name": "www.example334455.com", "Type": "A", "TTL": 600, "ResourceRecords": [ { "Value": "1.2.3.4" } ] } } ] } '
Note
|
You cannot delete a non-empty zone, have to 1st delete all records except NS. |
Trying to delete a zone with other than NS records gives this error:
An error occurred (HostedZoneNotEmpty) when calling the DeleteHostedZone operation: The specified hosted zone contains non-required resource record sets and so cannot be deleted
We delete the empty zone example334455.com:
aws route53 delete-hosted-zone --id Z0967968IADGHN5TI3WW