Published on

Getting Route 53 to Route Traffic to your S3 Static Website

Authors

If you're here, you're probably trying to work out why your Route 53 configuration for your domain name and website (hosted on S3) isn't working even though the propagation time for Route 53 is only 60 seconds. Or even after following AWS Route 53 guide on Configuring a static website using a custom domain registered with Route 53, your site is still not live via your domain name.

Chances are that you purchased a domain name on Route 53 and did not use it immediately, in which case you deleted the hosted zone that is automatically generated for you when you first register a domain on Route 53. Now you need to use the domain for your site on S3 and can't work out why things aren't working as expected.

An image with the caption: "I'll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it."

First make sure your S3 bucket name is the same as your domain name. If you do not already have a hosted zone setup for your domain name, go to Route 53 on the web console.

Create a Hosted Zone

  1. On your Route 53 dashboard, go to Hosted zones. Create a hosted zone and enter your domain name in the Domain text field. Leave Type as Public Hosted Zone.
  2. Click Create Record Set. Accept default values for Name (your domain name) and Type (IPv4).
  3. Select yes for Alias.
  4. Under Alias Target, click in the text field or drop down and select your S3 bucket name, which should be the same as your domain name.
  5. You can leave other settings as default unless you want to configure them. Then click Create.
  6. Note down the values of the name servers (NS) on the table for your hosted zone. There are usually four of them.

Update the Name Server

When you first buy a domain name on Route 53, the name server is usually the same as the hosted zone name server that is automatically generated for you. Creating a hosted zone manually means that you'll have to update your domain name server yourself to get things working on AWS.

  1. On your Route 53 dashboard, go to Registered domains and click on the domain name for your hosted zone.
  2. Look for Name servers entry and select Add or edit name servers.
  3. Replace the values with the ones you noted from your hosted zone record set. Save changes.
Copy name servers from hosted zone to domain name server record

Your site should be live via your domain name in a few minutes.

If your site is still not live after a few minutes, then it could be the classical DNS issue. For example, your Internet Service Provider (ISP) has not refreshed their DNS server in which case you'll have to wait for this to be updated.