← Return home

Static websites on AWS - Part II

In our previous article Static websites on AWS - Part I we've seen how to create a simple static web page and hosted it to AWS S3.

In this article we will see how to access this web page from a custom domain name (dusaitis.co).

Step 1 - Buy the domain name

When it's time to register a new domain name, papaki.com is my first choice. Papaki.com is one of the most reliable domain registars in Greece with great support.

We're going to register the domain name dusaitis.co.

image1-01

We added this to the basket and after some clicks we have purchased it.

image2-01

Step 2 - Set the Amazon Route 53

In this step you need to create a Hosted Zone. Hosted zones allow you to define how AWS Route 53 is going to resond to DNS queries for domain names such as dusaitis.co.

Click on the "Create hosted zone" button.

image3-01

Type your domain name and click on the "Create hosted zone" button.

image4-01-01

Two records were created. A NS and a SOA. You need the values from the NS record. Copy the values from the field "Value/Route traffic to" to the clipboard.

image5-01

Step 3 - Update the DNS values to your domain registar

Go back to your domain registar and configure the Namespace values of the domain name dusaitis.co.

Copy the four values one by one. Please make sure that you removed the last .(dot) from each record.

Eg: ns-1257.awsdns-29.org.ns-1257.awsdns-29.org (without the dot)

image-dns-records

After some clicks, the the DNS values will have been updated.

image7-01

When you update the DNS values it takes some time in order to see the change. Have a break about 20 ~ 30 minutes.

Step 4. Map the domain name with the S3 Bucket

Go back to the AWS Route 53. Choose the dusaitis.co hosted zone. Now you will create a simple A record which maps the dusaitis.co domain name with the S3 Bucket we created in the previous article Static websites on AWS - Part I .

Click on the "Create record" button.

image8-01

Then choose the "Simple routing" radio button, and then "Next".

image9-01

Click on the "Define simple record" button.

image10-01

In the "Value/Route traffic to" choose the "Alias to S3 website endpoint". Then, choose the eu-central-1 region. Choose the dusaitis.co S3 Bucket from the list and press the "Define simple record" button.

image11-01

Finally, click on the "Create Records" to create the A-type record and complete the process.

image12-01

Congrats! 🎉 you have completed the process! 🚀

image13-01

Again, when you update DNS values it takes some time in order to see the change. Have another break, and check it after (20 ~ 30 minutes).

Check it out at http://dusaitis.co

In the upcoming Static websites on AWS - Part III we will see how to run this site under HTTPS.

For more tips follow me on Twitter.

Thanks for reading!

Would you like to get updates for new stories?