How to Point your Domain to EC2 Instance using Route 53

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
have you ever wondered how a domain name like example.com ultimately points to your app that might be running in a separate environment take for example my portfolio website over here in Google psych.xyz how on Earth does it happen that I can just put this domain name in my browser and it knows exactly which app to bring to my screen or to bring to my browser and do you know that you can have one domain name pointing to thousands of applications running in separate environments wait you thought google.com was running one or using one server to serve its billions of users that's pretty hectic don't you think they use a concept called load balancing it's pretty mind-blowing and I'm going to explain it to you in the most simplest of term hello everybody my name is Google my channel is coding101 where we are dedicated to simplifying the most fundamental concepts of programming or coding if that is something that piques your interest be sure to like this video and subscribe to my channel and while you're subscribing let me just say if you haven't watched my previous videos leading up to this video be sure to check out some of our amazing content where I teach on how to build your very own real-time chat application using react nodejs and socket.io we also dabbled into Firebase and learned how to use the Firebase firestore database in the previous video I taught on how to deploy your application in the ec2 instance so be sure to check out those videos before you watch this one or you can just continue with this one did you subscribe alright let's continue so in today's video I'm going to be teaching you how to point your domain to your ec2 instance in the context of namecheap at godaddy.com but before we do that I do want to explain how that entire concept Works how on Earth does it happen that I can just put my domain name on my browser and the right app appears on my screen it is through a concept called reverse proxy so reverse proxy this is how it happens you use the internet to enter a domain name so this domain name is actually an address of where certain files can in the web server so there's something called a proxy that then uses that facilitates the communication between the internet and the web server if you put a domain name like example.com it goes to the right web server and it fetches those static files or those Dynamic files and brings them to the proxy and the proxy carries them to your browser or to the Internet so this entire process is called reverse proxy and we use nginx you remember nginx we had installed nginx in our ec2 server we use nginx in order to perform this reverse proxy now I also mentioned about load balancing so load balancing is actually a concept that prevents one server from being overwhelmed by tons of traffic so in this example what you're seeing over here we have multiple web servers running at the same time so we have something called a load balancer which sort of like direct traffic it chooses which server should be used at a specific set of time so that if another server let's say maybe it catches fire or is too overwhelmed by traffic at least other servers can be able to contain that traffic this is why there's an important concept of load balancing is very very crucial and very very important but today in today's video now that you've understood and understood the background what we are trying to achieve I'm going to be teaching you how to sort of like play the role of a reverse proxy and I'm going to teach you how to point your domain name that you're going to be purchasing from either namecheap or goddess.com and you're going to be pointing it to your ec2 application that you had deployed or that you have put into your ec2 instant is Illustrated in the previous video so the first thing that you need to do of course is that you need to go to namecheap.com or you can go to godaddy.com and you need to purchase a domain it's pretty simple the registration process is pretty simple and for now you can also just like Google some coupons and you can really save some bugs on these domain and there's some domains that are very uh you can use for testing purposes as well so go ahead and do that the registration process is pretty straightforward we don't need to struggle with that so we don't need to struggle with that now after you've purchased a domain be sure to uh be aware of where your app is running in terms of Ip so go to your instance and just like get this IP now the real world begins you're going to go to your Amazon remember in the previous video I did ask you to set up an Amazon account so you're going to go to your Amazon account and you need to search for route 53. I'm going to come over here to route 53. and you're going to click on create hosted Zone now I do want to mention though that I had already purchased a domain of my own so I'm going to be using Google sec.xyz so this is the domain that I'm going to be using for the purposes of this tutorial but but please do make sure that you have purchased your own domain in order to continue with this tutorial so now let's go back to our Amazon we're going to create a hosted Zone and what we're going to do here is that we're going to create our one we're going to put our domain over here dot XYZ like that you can choose to leave this part empty that's all you need to do actually and now you can come over here and click create it create the zone and then after you've created that zone what you need to do is that you need to create a record it's going to come here to click create record and you're gonna just click simple routing and it's just a simple wizard that is going to guide you through that process and then you're gonna click over here to Define a simple record and you're going to leave that as it is and this is fine and then as we go down you're going to just come over here and just say IP address or another value depending on the record type so this is fine and then in here you're just going to put you remember that public IP that I had spoken about you're going to put it over here if you can't find this just go to your instance and you should be able to find it in the configuration settings so that's the public AP that we're going to be using and then after you've done doing that just click Define simple record and then once you're done click create records but we're not done yet actually we have one more record to create so let's just go to create record and we're just gonna click next to find sample record once again I'm gonna come over here and just say www and then on value or Route traffic to we're just going to say Alias to another record in this hosted Zone and we're going to choose the one that we had just created we're going to click we're going to click Define a simple record but you're not done come over here and click create records so now within our DNS Zone we have created two Zone records so this is where our DNS sort of resides or where we control it using Route 53 so we have created some records that are in line with our DNS but what we need to do now is that we need to connect these records with our DNS or our domain name so we just need to take these records that you see over here on name server our name service and we need to take these name service we need to click into our click manage or manage my domain and I'm going to go down a little bit down over here so you can see that there were already some name service in there but I'm just going to get rid of them for the purposes of this tutorial because I had done this previously so I'm going to get rid of these ones and I'm going to use the new ones all right so once you're done copying all those name servers line by line make sure you come over here and you just click save the process is similar to that of godaddy.com so there's not really much comparison between namecheap and godaddy.com right so what we're going to do now is that we're going to wait uh about like an hour or two it normally takes about an hour or two but sometimes it takes a bit longer we're gonna just wait for these records or this DNS records to propagate so just like give it a bit of time and then come back to your domain and check if everything was done according to plan okay so it's been about 30 minutes since we've made the changes to our DNS so we're going to check in with our application I do want to remind you that because our application does not have um SSL you're going to see this not secure there's our application so you have this not secure over here and in order to fix that of course you would have to configure your SSL and that is the subject for another day another video another tutorial I'm going to show you how to do it but if you're actually interested in that please leave that in the comment section because I have a couple of videos planned so I want to know if this is something that is like super important to you uh you might know how to do it and that's still fine so yeah so this is our application we've managed to point our domain name to our application in our ec2 instance so you could pretty much see how simple it is uh thank you so much for watching please make sure that you have subscribed if you've enjoyed this video make sure that you've clicked the like button spam the like button right now if you have any comment any questions please make sure that you leave them in the comments section thank you so much for watching I will see you next time on coding 101
Info
Channel: Koding 101
Views: 30,063
Rating: undefined out of 5
Keywords:
Id: cfzHfazXalo
Channel Id: undefined
Length: 9min 38sec (578 seconds)
Published: Tue Nov 15 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.