LinuxCommandLibrary

aws-route53

Manage Amazon Route 53 domains and records

TLDR

List all hosted zones, private and public

$ aws route53 list-hosted-zones
copy

Show all records in a zone
$ aws route53 list-resource-record-sets --hosted-zone-id [zone_id]
copy

Create a new, public zone using a request identifier to retry the operation safely
$ aws route53 create-hosted-zone --name [name] --caller-reference [request_identifier]
copy

Delete a zone (if the zone has non-defaults SOA and NS records the command will fail)
$ aws route53 delete-hosted-zone --id [zone_id]
copy

Test DNS resolving by Amazon servers of a given zone
$ aws route53 test-dns-answer --hosted-zone-id [zone_id] --record-name [name] --record-type [type]
copy

SYNOPSIS

aws route53 <subcommand> [<options>]

Examples:
aws route53 list-hosted-zones
aws route53 get-change --id <change-id>
aws route53 change-resource-record-sets --hosted-zone-id <zone-id> --change-batch file://<path/to/changes.json>

PARAMETERS

<subcommand>
    Specifies the particular Route 53 API action to perform, e.g., list-hosted-zones, change-resource-record-sets, create-hosted-zone. Each subcommand has its own set of specific parameters.

--region <value>
    Specifies the AWS region to send the request to. Although Route 53 is a global service, this option can be used for consistency with other AWS CLI commands.

--output <format>
    Determines the output format of the command's response. Common formats include json, text, and table.

--profile <value>
    Specifies the named profile from your AWS credentials file to use for authentication.

--endpoint-url <value>
    Overrides the default service endpoint URL for Route 53.

--no-paginate
    Disables pagination for commands that return large sets of results, causing all results to be returned in a single call.

--cli-input-json <value>
    Reads command arguments from a JSON string or a file path (e.g., file://input.json). Useful for complex input objects like change batches.

--query <value>
    Applies a JMESPath query to filter and transform the command's output, allowing for precise data extraction.

DESCRIPTION

The aws-route53 command, which in practical Linux environments refers to the aws route53 subcommand of the AWS Command Line Interface (CLI), is a powerful tool for programmatically managing Amazon Route 53. Route 53 is a highly available and scalable cloud Domain Name System (DNS) web service. This command allows users to perform a wide range of DNS-related operations directly from their Linux terminal, scripts, or automated workflows. It enables the creation, deletion, and modification of hosted zones, management of various types of DNS records (A, AAAA, CNAME, MX, TXT, SRV, NS, PTR, SOA, SPF, CAA), and configuration of traffic policies such as latency-based, failover, geolocation, and weighted routing. Additionally, it supports registering and managing domain names, and configuring health checks to monitor the health of resources. The aws route53 command is essential for automating DNS infrastructure management, integrating with CI/CD pipelines, and ensuring efficient and reliable resolution of domain names to IP addresses or other resources within the AWS ecosystem and beyond.

CAVEATS

The aws route53 command requires proper AWS CLI installation and configuration, including valid AWS access keys and secret keys. Users must have appropriate IAM permissions to perform specific Route 53 actions. Operations like updating resource record sets often require complex JSON input, demanding a good understanding of DNS record types and AWS Route 53 API structure. Be mindful of DNS propagation times, as changes made via Route 53 commands may take time to reflect globally. Careless modifications can disrupt DNS resolution, leading to service outages.

COMMON USE CASES

Typical applications of aws route53 include:
- Automating DNS record updates in CI/CD pipelines.
- Programmatically creating or deleting hosted zones for new environments.
- Setting up complex traffic routing policies (e.g., failover, latency, geolocation).
- Managing domain registration and renewal processes.
- Scripting health check configurations for resource monitoring.

PREREQUISITES

To use aws route53, ensure you have:
- The AWS CLI installed on your Linux system.
- AWS credentials configured (via aws configure or environment variables) with sufficient IAM permissions for Route 53 actions.

HISTORY

The AWS Command Line Interface (CLI) was first launched in 2013, providing a unified tool to manage AWS services. Amazon Route 53 itself was launched earlier in 2010. Since its inception, the aws route53 subcommand has continuously evolved alongside the Route 53 service, adding support for new features such as traffic policies, domain registration enhancements, and new record types. Its development has focused on providing a comprehensive, consistent, and scriptable interface to all Route 53 functionalities, making it a cornerstone for DevOps practices and automated cloud infrastructure management.

SEE ALSO

aws(1), dig(1), nslookup(1), host(1)

Copied to clipboard