How to buy domain from Namecheap, connect to AWS Route 53 and attach AWS Certificate Manager

In this blog, we are going to learn how to buy a domain from Namecheap and connect it to AWS Route 53 (Hosted Zone). We are also going to attach an SSL certificate to the domain using the AWS Certificate Manager.

Although AWS provides DNS services through AWS Route 53, which you can use to purchase and manage your domain. But, what if you want to use another Domain name service provider (like Namecheap) due for reasons best known to you. How do you connect it to AWS so you can manage it from there? We are going to fix that here.

Steps to buying your domain from Namecheap

Go to your browser and type Namecheap.com. Click on the link and you will be directed to the Namecheap page.

You can either sign up before searching for your desired domain name or search for your domain name first and then proceed to sign up when you want to check out.

We are going to be signing up first, but if you already have an account, then log in. Now search for your desired domain, and if you're OK with it click add to cart and proceed with the payment.

After purchase, you should have something like this with the domain you bought.

Namecheap Dashboard

if you are not brought here, then just click on Dashboard, and click on Manage.

On this page, you will find details of your domain including the domain NAMESERVERS. This is what we are going to change to be able to connect it to AWS.

The NAMESERVER defaults to Namecheap Website Hosting DNS, yours might be Namecheap BasicDNS, it doesn't matter has we would be changing it to a custom NAMESERVER which would get from AWS.

Let's log into our AWS management console we would be coming back to Namecheap when we get the new NS from AWS.

How to create Hosted Zone in AWS Route 53

Now that we have gotten our domain name, it's time to create where it will live (aka Hosted Zone) in AWS.

A hosted zone is a container for records, and records contain information about how you want to route traffic for a specific domain, from our demo 'lestina.bio', and its subdomains (lestina.bio, app.lestina.bio, abc.lestina.com). In short whatever subdomain you choose. A hosted zone and the corresponding domain have the same name.

To create the hosted zone, sign in to your AWS management console. Search for Route 53 on the search bar. On Route 53 console, choose Get Started under DNS Management, if you have already used Route 53 before click on Hosted Zone. Create hosted zone using your domain name, then select the Public hosted zone, click Create hosted zone and you are done.

Note: Creating Hosted Zone costs 0.5$ per month, delete the hosted zone within 12hr of creation to not incur an cost

You should have something like this

AWS hosted zone dashboard

Once your hosted zone is created, Route 53 will automatically assign four nameservers to your domain. You'll need to update your domain's DNS settings with these name servers to begin using Route 53 to manage your DNS.

Click on the created hosted zone to get your assigned nameservers

This is the nameserver

What we are concerned with here is the NS records, these four records are what we would be updating our Namecheap Custom NAMESERVER with.

Back to Namecheap, update the custom NAMESEVER with the NS records, one after another. You should have something like this when you are done

updated NS records

You should see a pop-up that it might take up to 48 hours to propagate. To check if it has been propagated you can use the website Whois and input your domain name. you should have something like this

Congratulations, you have successfully completed the task. Now it's time to attach an SSL certificate to our domain.

How to request and connect ACM to our domain for more security.

An SSL certificate is a digital certificate that authenticates a website's identity and enables an encrypted connection. SSL stands for Secure Sockets Layer, a security protocol that creates an encrypted link between a web server and a web browser.

AWS Certificate Manager (ACM) is a service that AWS provides, that lets you easily provision, manage, and deploy public and private SSL/TLS certificates for use with AWS services and your internal connected resources. It removes the time-consuming manual process of purchasing, uploading, and renewing SSL/TLS certificates.

STEP TO REQUEST AND CONNECT YOUR DOMAIN TO ACM

  • Log in to your AWS Management Console.

  • Search for Certificate Manager in the space bar.

    In ACM you can either request a certificate, import a certificate or create a private CA. We would be requesting a certificate.

  • Click on Request a certificate.

  • Click on Next, because we are using a public certificate.

  • Input your domain name

  • Click on Add another certificate name and add *.yourdomain to include wildcards.

  • Leave the rest as default as it is recommended and proceed to request

AWS has made it easy to validate using DNS Validation, all you have to do is create a new record in your hosted zone with the provided CNAME.

You can do this by also clicking Create Records in Route 53

Give it some time and you should be validated, it might take a few seconds or minutes. If it doesn't get validated after a long while pls check the steps again and try to see if you missed some steps.

The status is now issued.

Congratulations, you just completed this project!!!

PS...

This is my first blog and it will be part of a series on How to host a static website on AWS and implement CI/CD ( S3, CloudFront, Route 53, Github, Codepipeline ).

Any comments on improvements or errors are welcome

https://www.namecheap.com/myaccount/login/

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/Welcome.html

https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-request-public.html

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/CreatingHostedZone.html

https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zones-working-with.html

https://aws.amazon.com/certificate-manager/

https://www.kaspersky.com/resource-center/definitions/what-is-a-ssl-certificate

https://aws.amazon.com/what-is/ssl-certificate/