
{"id":8121,"date":"2019-05-29T12:19:58","date_gmt":"2019-05-29T12:19:58","guid":{"rendered":"https:\/\/rax-stg-wp-aws.com\/blogs\/migrate-aws-dns-records-by-using-cli35\/"},"modified":"2026-11-03T19:29:26","modified_gmt":"2026-11-03T19:29:26","slug":"migrate-aws-dns-records-by-using-cli35","status":"publish","type":"blogs","link":"https:\/\/www.rackspace.com\/en-gb\/blogs\/migrate-aws-dns-records-by-using-cli35\/","title":{"rendered":"Migrate AWS DNS records by using cli35"},"content":{"rendered":"<p><strong>Introduction<\/strong><\/p>\n<p>When you migrate resources from one Amazon Web Services\u00a9 (AWS) account to another,&nbsp;you might be asked to migrate the Amazon Route 53\u2122; Domain Name Service (DNS) records&nbsp;as well. To do this, use cli53, a command line tool for Amazon Route 53, to migrate Route 53 DNS records from&nbsp;the source to the target. cli53 exports all the DNS records into a JSON file.&nbsp;After cli53 moves the records, you need to make some complex changes to the file&nbsp;before finally importing it to the target. This blog explains how to simplify&nbsp;the process of migrating all Route 53 DNS records from the source to the target.<\/p>\n<p><strong>Overview<\/strong><\/p>\n<p>Use the following steps to migrate DNS records by using cli53:<\/p>\n<p>1. Download and install cli53 from GitHub.<br \/>\n2. Create an identity and access management (IAM) user in both the AWS source and<br \/>\n&nbsp; &nbsp;target accounts.<br \/>\n3. Export the Route 53 DNS records from the source AWS account.<br \/>\n4. Import the Route 53 DNS records to the target AWS account.<\/p>\n<p><strong>&nbsp;Download and install cli53<\/strong><\/p>\n<p>Download the<strong> <a href=\"https:\/\/github.com\/barnybug\/cli53\/releases\/tag\/0.8.12\">cli53 utility from&nbsp;GitHub<\/a><\/strong><\/p>\n<p>To install cli53, select from the following installation instructions based on&nbsp;your operating system.<\/p>\n<p><strong>&nbsp;Linux<\/strong><\/p>\n<p>To install cli53 on Linux\u00a9 , run the following commands:<\/p>\n<p><em>&nbsp; &nbsp; $ sudo mv cli53-my-platform \/usr\/local\/bin\/cli53<br \/>\n&nbsp; &nbsp; $ sudo chmod +x \/usr\/local\/bin\/cli53<\/em><\/p>\n<p><strong>&nbsp;Apple Mac<\/strong><\/p>\n<p>To install cli53 on an Apple\u00a9 Mac\u00a9 , run the following command:<\/p>\n<p><em>&nbsp; &nbsp; $ brew install cli53<\/em><\/p>\n<p><strong>&nbsp;Microsoft Windows<\/strong><\/p>\n<p>You can run the cli53 executable (extension <em>.exe<\/em>) on Microsoft\u00a9 Windows\u00a9 without&nbsp;installing it.<\/p>\n<p>To verify cli53 on Windows, perform the following tasks:<\/p>\n<p>1. Open a command prompt.<br \/>\n2. Change directory to the location where you downloaded the cli53 executable.<br \/>\n3. Run the cli35 list command, as shown in the following image:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture1_13.png\" alt=\"clii53 pic 1\" \/><\/p>\n<p><strong>&nbsp;Create an IAM user&nbsp;<\/strong><\/p>\n<p>You need to create an IAM user on both the AWS accounts. cli53 requires one IAM&nbsp;user on the source AWS account to export all the DNS records to a plain text&nbsp;file and one IAM user on the target AWS account to import all the DNS records.<\/p>\n<p>Use the following instructions to create an IAM user:<\/p>\n<p>1. Log in to the source AWS account.<br \/>\n2. Go to the IAM service console and click <strong>Users<\/strong>.<br \/>\n3. Click <strong>Add User<\/strong><br \/>\n4. Enter your user name, select <strong>Access type -&gt; Programmatic Access<\/strong>&nbsp;and&nbsp;click <strong>Next: Permissions<\/strong>&nbsp;as shown in the following image.<\/p>\n<p>Use the following instructions to create an IAM user:<\/p>\n<p>1. Log in to the source AWS account.<br \/>\n2. Go to the IAM service console and click <strong>Users<\/strong>.<br \/>\n3. Click <strong>Add User<\/strong><br \/>\n4. Enter your user name, select <strong>Access type -&gt; Programmatic Access<\/strong>&nbsp;and&nbsp;click <strong>Next: Permissions<\/strong>&nbsp;as shown in the following image.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture2_11.png\" alt=\"cli53 pic 2\" \/><\/p>\n<p>Select <strong>Attach existing policies directly<\/strong>, type <strong>route53<\/strong>&nbsp;in&nbsp;the filter policies search bar, select the&nbsp; <strong>AmazonRoute53FullAccess<\/strong><br \/>\n&nbsp; policy, and click <strong>Next: Review<\/strong>&nbsp;as shown in the following image:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture3_7.png\" alt=\"cli53 pic 3\" \/><\/p>\n<p>&nbsp;The following screen displays:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture4_6.png\" alt=\"cli53 pic 4\" \/><\/p>\n<p>&nbsp; &nbsp;Click <strong>Create User<\/strong>. On the confirmation screen, shown in the&nbsp;following image, make note of your IAM <strong>Access key ID<\/strong>&nbsp;and <strong>Secret<br \/>\n&nbsp; access key<\/strong>. We recommend that you download your keys to a .csv&nbsp;file on your local machine.<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture5_6.png\" alt=\"cli53 pic 5\" \/><\/p>\n<p>Repeat the preceding steps for the target AWS account<\/p>\n<p><strong>&nbsp;Export Route 53 DNS records from the source account&nbsp;<\/strong><\/p>\n<p>The cli53 utility exports all Route 53 DNS records to a plain text file. This&nbsp;file has all the records. You can easily edit all the DNS records and their&nbsp;parameters. Use the following instructions to export Route 53 DNS records:<\/p>\n<p>1. Go to your <strong>.aws<\/strong>&nbsp;home directory and find the <strong>credentials<\/strong>&nbsp;file as&nbsp;shown in the following image:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture6_4.png\" alt=\"cli53 pic 6\" \/><\/p>\n<p>Open the editor and update the file, <strong>credentials<\/strong>, with your <strong>Access key id<\/strong>&nbsp;and <strong>Secret access key<\/strong>&nbsp;from the IAM user that you<br \/>\n&nbsp; created on the source AWS account as shown in the following image. Save the&nbsp;file.&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture7_4.png\" alt=\"cli53 pic 7\" \/><\/p>\n<p>Open a command prompt and run the list command to verify that&nbsp;you are on the source AWS account as shown in the following image:&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture8_4.png\" alt=\"cli 53 pic 8\" \/><\/p>\n<p>Run the following command to export the Route 53 hosted zones into the file&nbsp;from the source AWS account to create a plain text file with all the Route 53 DNS&nbsp;records.<\/p>\n<p><em>&nbsp; &nbsp; C:\\&gt; cli53-windows-386.exe export &lt;hosted-zone-name&gt; &gt; \/path\/to\/file&nbsp;<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture9_2.png\" alt=\"cli53 pic 9\" \/><\/p>\n<p><strong>&nbsp;Import Route 53 records to the target account&nbsp;<\/strong><\/p>\n<p>To import the DNS records to the target AWS account, you need to create hosted&nbsp;zones before importing the DNS records. Delete the <strong>NS<\/strong>&nbsp;and <strong>SOA<\/strong>&nbsp;DNS&nbsp;records from the plain text export file because these records are available in&nbsp;the target hosted zone. You should also update the credentials file with the&nbsp;target AWS account, IAM user <strong>Access key ID<\/strong>, and <strong>Secret access key.<\/strong><\/p>\n<p><strong>Use the following steps to import the DNS records to the target AWS account:<\/strong><\/p>\n<p>1. Delete the <strong>NS<\/strong>&nbsp;and <strong>SOA<\/strong>&nbsp;records from the export file. &nbsp;Also, if there&nbsp;is a different domain name on the target AWS account, update the domain<br \/>\nname under<em> $ORIGIN <\/em>in the plain text file and save the file.<\/p>\n<p>The following image shows the DNS file before the record deletion:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture10_3.png\" alt=\"cli53 pic 10\" \/><\/p>\n<p>The following image shows the DNS file after the record deletion:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture11_2.png\" alt=\"cli53 pic 11\" \/><\/p>\n<p>.Update the <strong>credentials<\/strong>&nbsp;file in your home directory to add the target&nbsp;AWS account IAM user <strong>Access key ID<\/strong>&nbsp;and <strong>Secret access key<\/strong>&nbsp;as shown in the following image:<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture12_1.png\" alt=\"cli53 pic 12\" \/><\/p>\n<p>Open a command prompt and verify that you have successfully switched to&nbsp;the target AWS account. Run the <strong>list<\/strong>&nbsp;command to check the hosted zones&nbsp;at the target site as shown in the following image:&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture13_0.png\" alt=\"cli53 pic 13\" \/><\/p>\n<p>&nbsp;If there is not already a hosted zone in the target AWS account, create one to use to import the DNS records from the plain text file by running the following command:<\/p>\n<p>&nbsp; &nbsp; <em>C:\\&gt; cli53-windows-386.exe create &lt;hosted-zone name&gt; &#8211;comment \u2018&lt;comments&gt;\u2019<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture14_0.png\" alt=\"cli53 pic 14\" \/><\/p>\n<p>Import the DNS records to the hosted zone on the target AWS account. Copy the hosted zone ID and run the following command:<\/p>\n<p>\n<em>&nbsp; &nbsp; C:\\&gt; cli53-windows-386.exe import &#8211;file &lt;\/path\/to\/file&gt; &lt;hosted-zone-name&gt;<\/em><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture15_0.png\" alt=\"cli53 pic 15\" \/><\/p>\n<p>Verify all of the DNS records on the target AWS account under the&nbsp;Route 53 management console and check that all the records are in place as&nbsp;&nbsp; shown in the following images:&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture16_0.png\" alt=\"cli53 pic 16\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture16_1.png\" alt=\"cli 53 pic 16\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/blog_article_images\/26607-body-Picture17.png\" alt=\"cli53 pic 17\" \/><\/p>\n<p><strong>&nbsp;&nbsp;Conclusion<\/strong><\/p>\n<p>Migrating DNS is a crucial activity in every migration. Manual changes in DNS&nbsp;record sets are error-prone and can lead to unavoidable outages. The cli53&nbsp;utility makes it easy to migrate all DNS records to the target AWS environment&nbsp;by creating a plain text file that is both easy to understand and update.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Migrate AWS DNS records by using cli35<\/p>\n","protected":false},"author":2,"featured_media":8123,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":{"content-type":"","nid":"26607","content_type":"blog","created_by":"10130","authored_on":"2024-02-13T13:19:58+00:00","field_article_industries":"","tag_category":"Technical","field_blog_author_text":"by Rackspace Technology Staff","seo_description":"Simplify the migration of Amazon Route 53 DNS records between AWS accounts using cli53, ensuring a smooth and hassle-free migration process.\r\n","field_featured_image":"","insights_image":"\/wp-content\/uploads\/2026\/blog_technical_images\/26607-insights_image-aws-technical-blog-1-insights.png","field_partners":"","rxt_platforms":"Amazon Web Services (AWS)","product":"","publisheddate":"2019-05-29T12:19:58","rxt_solutions":"Cloud, Applications, Application Management & Operations","opengraph_tag":"","x_tag":"","teaser_flag":"Technical Blog","seo_titile":"Migrate AWS DNS Records Using cli53 Utility | Rackspace Technology","field_topics":"","field_slug":"migrate-aws-dns-records-by-using-cli53","footnotes":""},"categories":[178],"tags":[204],"class_list":["post-8121","blogs","type-blogs","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-technical"],"_links":{"self":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8121","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs"}],"about":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/types\/blogs"}],"author":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/comments?post=8121"}],"version-history":[{"count":3,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8121\/revisions"}],"predecessor-version":[{"id":9909,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/blogs\/8121\/revisions\/9909"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media\/8123"}],"wp:attachment":[{"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/media?parent=8121"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/categories?post=8121"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rackspace.com\/en-gb\/wp-json\/wp\/v2\/tags?post=8121"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}