Want to point my domain to a new website

Hi,
I’ve got a website set up on here already, and it’s pointing to a Hostgator server. However, I’ve migrated the website to an EC2 instance, and so I need the domain to point there instead.
I see a whole list of IP addresses and nameservers in the DNS list, but I’m not sure which ones to edit/change and to what.

Should I just replace every instance of the old site’s IP with the new one?
Do ns1 and ns2 need to be changed? (Don’t recognize the IP)
There’s “gatorXXXX.hostgator.com” domains under SRV type, do they change to the new site IP too?
There’s references to cPanel; the new site doesn’t have cPanel. Should they be deleted?

I’ve gotten this far, but DNS stuff still alludes me. Any help would be much appreciated!

It sounds like when you added your site to Cloudflare, you imported the DNS records, and ended up with a bunch of stuff that you don’t really understand, but the system got everything and it all worked so you left it alone. But now you have to make a change, so not understanding it becomes an issue. That sound about right? :slightly_smiling_face:

It also sounds like there’s a lot of stuff in there that you really don’t need. So maybe we start from the beginning and look at what you need for your site.

You need entries with the IP address or addresses for the website itself, on the root domain and probably on www as well. For this, you need an entry for the root domain like example.com, of type A with the IPv4 address for the site. You may also have an IPv6 address in which case you make an AAAA record for example.com with that address. (You can enter @ as a shorthand for the root domain; you will see this in a lot of documentation so it’s important to understand that @ just means the root domain.) Set these to :orange: proxied.

You also probably need an entry for the server itself so you can log in with ssh or whatever. This would be an entry like server.example.com (where server is the server’s actual name) that is set to gray :grey: unproxied, pointing to the server’s IP address. (Or, you may just use an Amazon-provided name for ssh access, which is fine too and then you don’t need this.)

Then, if you’re doing email on the domain, you need the mail server records. Only your email provider can provide you with the correct information for this. If your email provider is separate from your website, then all this probably stays the same as it is now. If you have MX records this is what I’m talking about, and there would probably be at least one TXT record as well. (I’m assuming you’re not running your own email server on your EC2 instance; if you are, then all bets are off here and you need to know what you’re doing.)

Entries for things like ns1 and ns2 are almost certainly not needed at all. Your domain’s NS records will be managed by Cloudflare automatically if you don’t create your own, and if you needed your own, you would know it.

I have no idea what Hostgator was using SRV records for. If all you’re running is a website (not something like a Minecraft server) then these are not needed at all and can be deleted. If you have other kinds of services running besides web, then we would need more information to know what to do here.

If you have no cPanel on the new setup then you don’t need any entries for that.

If you want to post a screenshot of your DNS entries so someone can look over them, go ahead.

2 Likes

Haha that’s exactly what happened, you saw right through me.

Thank you so much for the detailed response – this makes so much sense & will set me right for the setup I need! :pray:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.