How do I transfer ownership of a domain or an Amazon Route 53 hosted zone to a different AWS account?
Last updated: 2022-12-06
I want to transfer ownership of a domain or Amazon Route 53 hosted zone from one AWS account to another. How can I do this?
You can transfer a domain from one AWS account to another using the TransferDomainToAnotherAwsAccount command.
Although it's a best practice to transfer a domain using an API call, you can also transfer a domain by contacting AWS Support.If you don't own both the source and destination accounts that you're transferring the domain to and from, you must do one of the following:
- Migrate the existing hosted zone to the AWS account that you're transferring the domain to,
- Create a new hosted zone in an AWS account that you own.
Migrate a hosted zone
Follow the steps in Migrating a hosted zone to a different AWS account.
Transfer a domain
Note: If you receive errors when running AWS Command Line Interface (AWS CLI) commands, make sure that you’re using the most recent AWS CLI version.
1. Run the following command in the AWS CLI. Replace example.com with your domain name. Replace 111122223333 with your AWS account ID.
aws route53domains transfer-domain-to-another-aws-account --domain-name example.com --account-id 111122223333 --region us-east-1
2. In the output, note the Password value.
3. To accept the transfer, log in to the AWS account that is the destination account. Then, run this command. Replace example.com with your domain name. Replace YourPassword with the password that you noted in step 2.
aws route53domains accept-domain-transfer-from-another-aws-account --domain-name example.com --password YourPassword --region us-east-1
If you receive errors accepting the transfer, see the Troubleshoot accepting a domain section of this article.
Note: The accept-transfer command must be completed within three days of the transfer domain call. After three days, the transfer is canceled.
4. After accepting the transfer, view the domain by accessing the Route 53 console and then choosing the Registered Domains tab.
Troubleshoot accepting a domain
If you encounter errors while accepting a transfer, then the generated password might contain special characters. Use one of two options to solve this:
(Option 1) Use a text file to accept the domain transfer
1. Create a .txt file that contains the password that was generated in Step 2 of the Transfer a domain section. Use a simple format.
2. Run the accept-transfer command:
aws route53domains accept-domain-transfer-from-another-aws-account --domain-name <domain name> --password file:///tmp/password.txt --region us-east-1
(Option 2) Use quotation marks around the password strings
Use single or double quotation marks around your password to prevent the AWS CLI from misinterpreting special characters.
The following example uses double quotation marks:
aws route53domains accept-domain-transfer-from-another-aws-account --domain-name example.com --password "YourPassword" --region us-east-1
The following example uses single quotation marks:
aws route53domains accept-domain-transfer-from-another-aws-account --domain-name example.com --password 'YourPassword' --region us-east-1