Switching hosting from GoDaddy to AWS

5,275

Solution 1

The 4 values you got from Route53 are name servers - they provide the location of where your records are stored (i.e. with Route53). In Route53, you need to have your actual A records. Previously, you (presumably) had one or more A records with GoDaddy which pointed to the elastic IP address of your EC2 instance, now, you need to recreate the same records in Route53 so that a lookup pointed to Route53 (which will be your new nameserver once the change propagates) will return the same record set that you previously had with GoDaddy.

When you access Route53, you get a list of your hosted zones: enter image description here

Select one of them and 'Go to Record Sets':

enter image description here

From there, create a new A record, that points at your elastic IP address.

Update to address your comment:

You have a website, it has some code that renders it. The question is, when I type in example.com into my browser, how do I get to view your code? My browser will do a DNS lookup starting with the root nameservers (.) (which it should already know) - these will provide a list of .com nameservers, where it can lookup the nameservers for example.com. Those nameservers will provide the IP address that can be used to access your code. Your browser then goes to that IP address, and passes a host header to specify which domain it is trying to access (for instance, there could be multiple domains on the same server).

In order to move from GoDaddy to AWS, you can a) just move your code to AWS (if you have a static website, move it to S3 instead of EC2), and point your GoDaddy DNS records at your new host (e.g. your EC2 instance's IP address). In EC2, your instance's IP address will change when the instance reboots, etc. As such it is a dynamic IP address, not well suited for hosting a website. Instead, you need to allocate a static IP address, once that can be assigned to an instance - AWS call this an 'Elastic IP'. This is what you will use for your A record. (The same holds true whether you use GoDaddy's DNS or Route53 - you need an A record that points to the IP address of your server - but there is no requirement to use Route53 just because you are using AWS to host your site - there are some exceptions - e.g. using an elastic load balancer).

enter image description here

Solution 2

Both domain name and hosting provider is same in your case,You need to go to the Godaddy account and then go to the DNS manager nad have to add A record for new hosting provider ip address that is AWS hosting and also change the DNS to point to AWS hosting provider.

To change namerserver at Godaady:

1.Log in to your Account Manager.

2.Next to Domains, click Launch.

3Select the domain name(s) you want to modify.

4.From the Nameservers menu, select Set Nameservers.

5.Under Setup type, select Custom.

6.Select Add Nameservers.

7.Enter the two nameservers your hosting provider gave you.

You find @ ip address entry for the your domain,change that entry to aws public ip address. It will take to propagate the dns globally.

Solution 3

Since you were hosting both your domain and website with Godaddy, you probably didn't have to deal with the DNS, they did it automatically for you.

Now that you have Route 53, you need to create a zone for your domain, create all the records such as A record and the MX records for your email to point to the elastic ip of your EC2 instance.

In conclusion, you have to create an A record like this:

yourdomain.com  IN  A   50.115.165.28
www.yourdomain.com  IN  A   50.115.165.28

For MX records (Mail exchange)

yourdomain.com  IN  MX  preference: 5 exchange: mailservergoeshere.com

You can set ppriority to 0 if you only have one server. Lowest priority comes first.

Share:
5,275

Related videos on Youtube

Lance
Author by

Lance

Updated on September 18, 2022

Comments

  • Lance
    Lance over 1 year

    For the longest time, I've had GoDaddy host my website. I have a domain name that has been registered with GoDaddy and is currently hosted with them. I read this article and created a new hosted zone via Route 53 and then got the delegation set values and plugged the 4 values into GoDaddy as the nameservers. I know that this can take a few hours to take effect, but where do I specify which ec2 instance to use? I have several instances running on my AWS account, but only one has my code that's relevant to my website that I'm focused on.

    • dawud
      dawud almost 10 years
      Could you please change the title of the question to something more meaningful?
    • Lance
      Lance almost 10 years
      Sorry. I'll do that ASAP
  • Lance
    Lance almost 10 years
    Actually, I don't think that I had any A record with GoDaddy. My site was hosted with them, not AWS. I'm just switching hosting to AWS now. So, I need to create an A record that points to an elastic IP?
  • Lance
    Lance almost 10 years
    What should my elastic IP address be?
  • cyberx86
    cyberx86 almost 10 years
    You don't get to choose your elastic IP. You allocate one, and then associate it with the instance you want to use it with (you can move it between instances if needed). It remains the same until you release the IP address (even it is not associated with an instance). Just ensure you allocate an IP address in the same region (e.g. US East) and scope (i.e. EC2 or VPC) as the instance you want to associate it with.