Table of Contents

Transfer Domain to AWS

Summary: Follow the steps to transfer a domain to AWS Route53.
Date: 26 April 2020
Refactor: 29 April 2025: Checked links and formatting.

After Getting Started With AWS and Getting Started With Office 365 I now also want to migrate my website to aws. This article describes the steps to do so. Used technologies:

Note that I'm actually transferring my test domain warmetal.nl to AWS in this article.


If you're looking on registering a new domain in AWS see the register_new_domain, as that is described here as well.

Before You Start

Take Notes

Take notes of your current DNS records, as some of them will need to be re-entered at Route 53. For the very minimum you'll need all records related to email (MX and possibly CNAME and TXT).

This was the list I had, just to give you an idea:

A warmetal.nl 83.137.194.58
A * warmetal.nl 83.137.194.58
A localhost warmetal.nl 127.0.0.1
CNAME autodiscover warmetal.nl autodiscover.outlook.com
MX [Highest (10) Priority] warmetal.nl warmetal-nl.mail.protection.outlook.com
MX [Default (30) Priority] warmetal.nl warmetal.nl
TXT warmetal.nl MS=ms39844372
TXT warmetal.nl v=spf1 include:spf.protection.outlook.com -all
SRV _autodiscover._tcp warmetal.nl 100 443 autodiscover.hosting2go.nl
HOST warmetal-nl.mail.protection.outlook.com

Your name servers might also be nice to review, as they change over the course of this article and you might want to know the old values. To check you can use this link: https://viewdns.info/dnsrecord/?domain=warmetal.nl

ns1.hosting2go.nl; ns2.hosting2go.nl
SOA: ns1.hosting2go.nl

Requirements before Transfer

Before you can transfer a domain to AWS there are some requirements you need to check some requirements. It basically comes down to:

You can check the status by doing a whois search here for .nl or here for all domains.

If you want to know what the status means check the ICANN website and search for “EPP status codes”.

Start Transfer of DNS

Cancel your current hosting

Transferring a domain starts with cancelling your current hosting to retrieve the authorization code. This depends on the registrar:

DNS

Start by transferring DNS first:

Create the records you noted before you began by clicking Create Record Set.

Name Servers

In the hosted zone you now see the name servers for your domain, in my case they were:

ns-709.awsdns-24.net
ns-1656.awsdns-15.co.uk
ns-1291.awsdns-33.org
ns-211.awsdns-26.com

Provide the NS servers to the registrar to have these updated. (otherwise the internet will keep pointing towards the old hoster, probably until the (ended) contract actually ends)

You have now successfully transferred the dns hosting of your domain.

Transfer Domain

Now you can transfer the domain.

Transfer Domain from Route 53

Note that from this point you can do nothing more but wait. With me it only took a few hours before everything was done.

Create DNS Records and Aliases

My domain is now a static S3 website, so I took these steps to make sure the A records point to the correct S3 bucket:

Repeat this step to create a second record for your subdomain. For the second record, type www in the name field. This will route internet traffic to the www.warmetal.nl bucket

You specify the same value for Alias Target for both records. Route 53 figures out which bucket to route traffic to based on the name of the record. For the first record it lets you choose the specific S3 bucket, for the second one the domain name.


Note it can take up to 30 minutes before the new A records work. In my case the domain and the redirect worked immediately.

Add Certificate to S3 Website

To make sure the website is available over a secure connection you need to request a certificate. But as S3 is static, you'll need a service to provide these certificates to your website visitors. So we'll use AWS Certificate Manager to create the certificate and Cloudfront to provide the secure endpoint for our S3 website.

In short, you'll need to follow these steps:

AWS Certificate Manager

You now can check if you want in route 53 that the records have been created, and in my case I had to wait somewhere between 5 and 10 minutes for the domain to verify. IN AWS Certificate Manager the certificate is now available.

Note that the certificate has a Renewal Eligibility as InEligible. This will change to Eligible as soon as you use the certificate with Cloudfront for your website.

CloudFront

In the CloudFront console you should now see your Cloudfront domain name, something like d3kxw0a7zy32o4.cloudfront.net

Access Denied Error for CloudFront Distributions

If you don't set the default root object (to index.html) you'll run into this error:

This XML file does not appear to have any style information associated with it. The document tree is shown below.
        <Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>38627D4AC9B31057</RequestId><HostId>rtPkecF6qx7M8EwQEszNo/5r7W8xe0nGoaz3zrUIWyMT4nHokN5IkQym7qoeh68qdC831IUqARM=</HostId></Error>

Route 53

Before:

warmetal.nl. A ALIAS s3-website-eu-west-1.amazonaws.com. (z1bkctxd74ezpe)
www.warmetal.nl. A ALIAS warmetal.nl. (z31sryyd9xxxqi)

After:

warmetal.nl. A ALIAS d3kxw0a7zy32o4.cloudfront.net. (z2fdtndataqyw2)
www.warmetal.nl. A ALIAS warmetal.nl. (z31sryyd9xxxqi)
Note that the second one, the alias for www has not changed.

You can now check if everything is ok, if it's not working after 30 minutes check the Cloudfront distribution status. It can take a while to go from “In Progress” to “Deployed”

Change a Static S3 Website with CloudFront

Cloudfront also caches your website. To invalidate the cache so your changes are displayed immediately:

Register New Domain

Registering a new domain: what's next?

Took only a few minutes before I got the email with confirmation on registering.

Useful Links