AWS Networking and Content Delivery
How to Register a Domain Name Using AWS Route53
Registering a domain name can be a little tricky if you are new to AWS. In this article, we will learn how to register a domain name using AWS Route 53.
Route 53 is Amazon’s domain registration and management service that helps users to register new domain names and point them to AWS resources (and other servers outside AWS). If you have experience registering a domain name using any other registrar like Godaddy or Namecheap, Route53 should be a cakewalk for you.
Let’s register a new domain using Route53 and take a look at how to configure various record types.
REGISTERING A DOMAIN
Route53 supports most of the common domain extensions including .io and .xyz. In this tutorial, we will register a domain name awstutor.io and point it to the calculator app that we built in our last tutorial.
Log in to the console and search for Route53 in the ‘Find Services’ menu. In the route53 dashboard, search for the domain name under ‘Register Domain’ text box and click ‘Check’. Route53 will list the available domain extensions for you.
If the domain you are looking for is not available, search for a new one or choose an alternative extension. Click ‘Add to cart’ and then click ‘Continue’ at the bottom of the screen.
Enter the registrant details on the next page. You can enable ‘Privacy protection’ which will hide your address when someone tries to look up the domain details. Click ‘Continue’.
Complete your order on the next section. If you have a payment method enabled, your order should go through immediately. If not, find the full guide on managing payments here.
Wait for a few hours for AWS to register the domain. Usually, it happens in less than an hour and you will receive an email notification once the registration is successful.
POINT TO S3 WEBSITE
Let's point the new domain that we just bought to an S3 bucket. Assuming you have gone through the previous tutorial of setting up a website on S3, we will configure our domain to point to the s3 bucket.
Rename your s3 bucket with your domain name. This step is important since I have often run into ‘BucketNotFound’ errors if the bucket name doesn’t match the domain name.
Once you have changed the bucket name, go into your Route53 console. In Route53, domains are called ‘Hosted Zones’. Click on ‘Hosted Zones’ link under ‘DNS Management’ and you will see the list of domains you have registered using Route53.
Click on your domain and you will see the list of pre-defined records created for your domain. We are going to create a new ‘Alias’ record which will point to our S3 bucket, which in turn, will render the website we have hosted in our bucket.
Click on ‘Create Record Set’ and in the create menu, leave the ‘Name’ field empty (unless you are creating a sub-domain in the future) and click on the ‘Yes’ radio button for Alias.
The ‘Alias Target’ dropdown will appear. Select the bucket you just created/renamed and click on ‘Create’.
Wait for a few minutes. Now when you enter your domain name on your browser, you should see the website hosted in your S3 bucket being served by Route53.
In case you want to set up a domain redirect, i.e, redirect to an entirely new URL, you have to set it up through S3 as well. This is a bit tricky since Route53 doesn't allow you to set up redirects within its console.
Create/rename an S3 bucket to match your domain name. In the ‘Properties’ menu of your bucket, go to the ‘Static website hosting’ option. Choose the ‘Redirect requests’ radio button and enter the URL you want the bucket to redirect to.
You can see that the domain ‘awstutor.io’ redirects to our medium publication (since our website is under construction). Click ‘Save’. The redirect will take a few minutes to work and you can see your Route53 domain redirecting you to the site you entered in the S3 target domain.
Route53 is a domain registration and management service offered by AWS. It allows you to register and configure all types of domain extensions and point them to AWS services or third-party resources. Hope you found this article useful in getting to know Amazon Web Services better. If you have any questions, let me know in the comments.
Don’t forget to clap if you liked this article. If you have a topic you would like me to write about, let me know in the comments.
Signup for our weekly newsletter and I’ll send you a summary of articles every week. No spam. No ads.