Take the 2-minute tour ×

I have a website with DNS pointing to my hosting account at ns1.a.com and ns2.a.com

I want to switch a hosting account (to ns1.b.com and ns2.b.com).

However if I simply change the DNS the site will be inaccessible until the change is complete, is there anyway to change host for a website without suffering from downtime?

share|improve this question

migrated from programmers.stackexchange.com Jul 27 '11 at 8:39


3 Answers 3

I think you may be mistaken.

The site won't be inaccessible while the change is propagated to the other DNS servers. You will just likely have some people directed to the old site and some people directed to the new during the transition, or more accurately some will be directed to the old IP address and others to the new IP address. If you don't have concerns about this, you should be fine.

Just make sure to leave the site active at the old location until the transfer is complete, unless you have explicit reasons not to do this.

share|improve this answer
We did this earlier this year... as John says there will be some people that get directed to the old site and some to the new while the transfer is being completed. There will be no downtime as such. –  Vince Pettit Jul 27 '11 at 12:34

I do this all of the time for customers.

  1. Duplicate the site from host A onto host B.
  2. Cut over the DNS to point to host B.
  3. Cancel the host A account.

The only gotcha in all of this is if the site is very dynamic. If it's only you (or a small group) that are making changes, then just schedule accordingly. Larger groups may need to be locked out from making changes to the old site. Even more dynamic sites (heavily trafficked blogs w/comments) are trickier.

share|improve this answer
In that situation it might make sense to implement some functionality to re-point the site's back-end DB to the new location (which should take effect immediately) so that both sites are pointing at the same DB temporarily. –  JohnFx Jul 27 '11 at 0:33
@JohnFx: Right, assuming that you can get outside access to the DB. Many hosting companies limit you to within-LAN access. I tend to run dedicated hosts so it's sort of a nonissue, but shared hosting is a different beast. –  Peter Rowell Jul 27 '11 at 0:47
@JohnFx yes i can't afford to have people writing to both old and new DBs during the transition. my old host doesn't allow me to connect to my new DB. what other tricks can i employ to make sure everything is proper? –  Pacerier Jul 27 '11 at 9:56

If you keep your files on old server, there will be no downtime.

DNS is cached heavily, and is only refreshed every hour (in most cases)

It does not matter what happens during that hour, because it's still on old server and your DNS record is still the same (only refreshed once a hour, and switched to new server with files ready), so you will have no downtime

share|improve this answer
but that's a problem. my old host doesn't allow me to connect to my new DB. so my data is at 2 places and people querying the data will be feeling like the data is screwed up (since they aren't interconnected). what solutions do you recommend? –  Pacerier Jul 28 '11 at 7:53
just keep connecting DB to your old host. After switching DNS, wait few hours, switch DB and it will be OK for everyone –  genesis Jul 28 '11 at 12:08

Your Answer


