DEV Community

Cover image for Transfer a domain between AWS accounts
Stefan Alfbo
Stefan Alfbo

Posted on

1

Transfer a domain between AWS accounts

It is easy to transfer a domain from one AWS account to another AWS account with the help of AWS CLI.

These commands are done with AWS CLI in bash.

# Make sure that you have the AWS CLI installed
aws --version
Enter fullscreen mode Exit fullscreen mode

We will use the command route53domains and its sub commands to do the transfer.

Three things are needed for the first step, the domain name to transfer, the account id that should have the domain name and the credentials (perhaps as an AWS CLI profile) of the owner of the domain.

aws route53domains transfer-domain-to-another-aws-account \
    --domain-name example.com \
    --account-id 111122223333 \
    --region us-east-1 \
    --profile DomainOwner
Enter fullscreen mode Exit fullscreen mode

Note that it's important that this is done in the us-east-1 region since the route53 service is global. The error message would look like this otherwise.

Could not connect to the endpoint URL: "https://route53domains.eu-west-3.amazonaws.com/"
Enter fullscreen mode Exit fullscreen mode

If the transfer was successful, then there would be a response with an operation id and a password.

# the response depending on you output preference
984188c3-1238-457c-a4ab-c6cc064f043d    =xfdf%/fj/5nr=
Enter fullscreen mode Exit fullscreen mode

Command for checking the status of the transfer.

aws route53domains get-operation-detail \
    --operation-id 984188c3-1238-457c-a4ab-c6cc064f043d \
    --profile DomainOwner
    --region us-east-1
Enter fullscreen mode Exit fullscreen mode

The last step is to accept the transfer with the account that should receive the domain, which means that we need the credentials for that account when running the AWS CLI commands. The domain name and the password from the first command will also be needed here.

aws route53domains accept-domain-transfer-from-another-aws-account \
    --domain-name example.com \
    --password =xfdf%/fj/5nr= \
    --profile DomainReceiver
    --region us-east-1
Enter fullscreen mode Exit fullscreen mode

All done, the last command will also get an operation id in the response that could be used to check the status with the sub command get-operation-detail as described above, remember to use the correct profile.

Resources:

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (1)

Collapse
 
szabgab profile image
Gabor Szabo

Congratulations for your first post!

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

Best practices for optimal infrastructure performance with Magento

Running a Magento store? Struggling with performance bottlenecks? Join us and get actionable insights and real-world strategies to keep your store fast and reliable.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️