DEV Community

Mubbashir Mustafa
Mubbashir Mustafa

Posted on • Updated on

Point your domain to AWS using Route 53

If you intend to use your domain with various services offered by AWS then you need to use Route 53 and point your domain to AWS*.

1. Create Hosted Zone

From AWS console, go to "Route 53" and select "Create hosted zone"
Alt Text

Enter the domain name you want to point to AWS (it can also be a sub-domain), select "Public hosted zone" and click "Create hosted zone"
Alt Text

Once the hosted zone is created, copy the NS (Nameserver) values (you will need them in the next step)
Alt Text

2. Update NS Records in your domain

ℹ️ Basically, in this tutorial, I have assumed that the domain you intend to point to AWS has been registered using a registrar other than Route 53 itself

Login to your domain registrar's account, select the domain and edit the NS records.

Screenshot refers to porkbun since I have registered my domain with them, but the setup is essentially the same for every registrar (GoDaddy, Namecheap, Domain.com, Name.com, .etc)

Click on edit NS (Nameservers)
Alt Text

Enter the NS record copied in the previous step and then click "Submit"
Alt Text

That's it, once the changes have been propagated you will be able to use your domain/sub-domain(s) with the desired AWS services.

ℹ️ Name server changes usually take 24 to 48 hours to fully start working



* ℹ️ You can attach your domain to any AWS service without moving the hosted zone to AWS:

Lightsail/EC2

  • Attach a static IP to the instance
  • Create a new A record and point it to that IP

ECS, EKS, etc. (resources to which you can't attach static IP)

  • Attach ELB (elastic load balancer) to the resource
  • Create a new CNAME record and point it to the URL of the ELB

S3, Cloudfront, Amplify, Elastic Beanstalk, etc.

  • Create a new CNAME record and point it to the URL of the resource

But AWS route 53 comes with its own set of advantages and route 53 helps to connect the request of the user to infrastructure running in the AWS. If your infrastructure is running on AWS then I would suggest pointing your domain's NS to Route 53's hosted zone.

Top comments (5)

Collapse
 
rishadomar profile image
Rishad Omar

Hello Mubasshir. I have a requirement very much like the one you describe above. However, instead of porbun I'm using xneelo.
Xneelo support suggested I change the @ and www records in xneelo to point to the IP address on AWS server. However, the newly created hosted zone on AWS does not have an IP address.
I don't have a WIX site but this is the description of steps to point xneelo domain to the WIX site. support.wix.com/en/article/connect...

On Route 53 I created a new hosted zone.
But not sure how to find the IP address to use in xneelo. Any ideas?

Collapse
 
mubbashir10 profile image
Mubbashir Mustafa

Hi Rishad, so your DNS would have been moved from Xneelo to Route 53. The next step is to add CNAME/A Name records as described in the wix tutorial. You will need to do that in Route 53 now.

But first make sure your NS has been moved to Route 53; dnschecker.org/ns-lookup.php is one of such tools.

Collapse
 
kevin01500 profile image
Blanc Kévin

Hello !

I follow your tutorial and my NS propagation is good. (I had a porkbun name domain too). Now I don't know what I could do ? Do you know some videos/tutorial ? (my goal is to create a system io website, but for now i only want to host nicely my domain etc and don't know what i could make, like only NS changement is not full hosting, right ?

Collapse
 
briankissler profile image
Brian Kissler

S3, Cloudfront, Amplify, Elastic Beanstalk, etc.
Create a new CNAME record and point it to the URL of the resource

I tried this with my porkbun domain and it doesn't allow me to create a CNAME with my Cloudfront distribution url. Any suggestions?

Collapse
 
mubbashir10 profile image
Mubbashir Mustafa • Edited

Is your domain top level (i.e domain.com)? CNAME records can't be added for top level domains and only for sub-domains. Some DNS service providers do provide alternatives: CloudFlare provides you CNAME Flattening, using which you can map top level domain to a CNAME record. Similarly, AWS Route53 provides alias that you could use.

So here are few things that are coming to my mind:

  • Use sub-domain (if possible)
  • Move DNS of your domain from porkbun to Cloudflare (free) or AWS Route53 ($0.53/month I guess) and then add that
  • Use reverse proxy (e.g launch nginx server on EC2 and configure it to work with your CNAME value, add ipv4/ipv6 value of the instance to your domain)