DNS zone and record builder
Build an entire cloud DNS change in one editable table.
TYPENAMEVALUETTLPRIORITY
# Create the hosted zone once, then save its Id as HOSTED_ZONE_ID
aws route53 create-hosted-zone --name example.com --caller-reference $(date +%s)
cat > change-batch.json <<'JSON'
{
"Changes": [
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "example.com.",
"Type": "A",
"TTL": 300,
"ResourceRecords": [
{
"Value": "1.2.3.4"
}
]
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "example.com.",
"Type": "MX",
"TTL": 300,
"ResourceRecords": [
{
"Value": "10 mail.example.com"
}
]
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "example.com.",
"Type": "TXT",
"TTL": 300,
"ResourceRecords": [
{
"Value": "\"v=spf1 include:_spf.google.com ~all\""
}
]
}
},
{
"Action": "UPSERT",
"ResourceRecordSet": {
"Name": "www.example.com.",
"Type": "CNAME",
"TTL": 300,
"ResourceRecords": [
{
"Value": "example.com"
}
]
}
}
]
}
JSON
aws route53 change-resource-record-sets --hosted-zone-id "$HOSTED_ZONE_ID" --change-batch file://change-batch.jsonDNS noteCheck provider zone ownership, existing records, delegated name servers and TTL requirements before applying a change. This generator does not modify your DNS automatically.