1

I have two hosts with different IPs.
The first one (say host A) serves the old version of website at site.com, plus some subdomains and emails ([email protected]).
Host B serves the new version of website at site.net plus some subdomains.

Both site.com and site.net have been live for some time, but now, the new version of website is ready and I want to change its domain.

I want to change from this:

site.com (host A) - Old version of website
subdomain.site.com (host A)
[email protected] (host A)

site.net (host B) - New version of website
subdomain.site.net (host B)
[email protected] (host B)

to this:

site.com (host B 🔅) - New version of website
subdomain.site.com (host A)
[email protected] (host A)

site.net (? 🔅) - ?
subdomain.site.net (host B)
[email protected] (host B)

I'm thinking of changing A record of site.com at host A to point to host B, and keep the subdomains and emails at their own hosts.

Now I have two questions:

  1. Is this approach safe? I mean, does changing the A record of site.com affect other subdomains or email in unexpected ways? If yes, what's the correct way to swith the domains?

  2. What should I do with site.net domain? should I point both site.com and site.net to host B, where the new version of website is? Or point site.com to new version and make site.net redirect to site.com?

3
  • If there is a relation between the domain and a sub-domain, for instance, they share cookies, you should be careful moving away the domain from server A. Sep 24 at 8:29
  • @KIKOSoftware this seems incorrect - https can not associate with an IP, only a domaib.
    – davidgo
    Sep 24 at 9:45
  • @davidgo You have a point. It was only an example, but I agree it was a bad one. It should be something they share on the server, like a session. Sep 24 at 9:52

2 Answers 2

1

This should be fine. A few things which may help.

e-Mail uses MX records for routing/delivery. It only uses A records as an absolute last resort if it can't find any MX records - a legacy thing no one should be relying on. As long as your MX records are correct, how you route email should not impact on your website availability.

Websites are not (at the protocol level) bound to IP addresses - thus which IP address is associated with which website won't affect this. Of-course, different IP addresses may imply different systems and/or connections and it is possible that if the performance of the systems are different there might be an SEO impact due to speed/performance.

Of-course, you need to ensure the HTTPS certificates and web config match domains appropriately or things will break.

0

Is change the A record of main domain safe

In most cases, running a website off an A record is not safe. Changing it shouldn't have additional adverse impacts.

in unexpected ways?

I don't know what you are expecting. I probably expect something different. There will be a transition period (expect the greater of 3 hours or twice the TTL) during which clients will still connect to the old host.

If you are provisioning certificates via HTTP-01 then you need to think about how this will be handled.

What should I do with site.net domain? should I point both site.com and site.net to host B, where the new version of website is? Or point site.com to new version and make site.net redirect to site.com?

I don't know what you mean by "point to". Unless you have very specific reasons for doing so, then you shouldn't have the same site presented under 2 hostnames (shards your SEO points). If it were me I'd add add canonical haeders everywhere pointing to the domain I was going to keep.

4
  • Thanks for the answer. For second part, where should I put canonical headers? I'm thinking of redirecting all site.net/(.*) to site.com/$1, so is canonical headers a server side thing?
    – Shahriar
    Sep 22 at 18:12
  • yes, with a scheme
    – symcbean
    Sep 23 at 1:52
  • Why twice the TTL?
    – davidgo
    Sep 24 at 1:42
  • Rule of thumb (but based on measurement).
    – symcbean
    Sep 24 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.