Keeping Your Website Up While Changing Web Hosts
Those of us who have our own websites would inevitably reach a point where we may have to shift our websites for one reason or another. There are times when the web hosting plan may not cope the new demand of the traffic and moving up the plans from within the web hosts or to a new provider. Whatever it is, we would need to embrace changes.
Over the years, I have probably changed web hosts more than 10 times. In the very beginning, it comes with a lot of downtime as I did not know what I was doing. A shift will certainly require some kind of planning to ensure the transition is smooth.
One of the key component is the DNS Server settings. The DNS Server or the Domain Name System Server is like the address book of the internet which pairs the Domain Name to the IP Address which is the physical address of the web server or web site. Think of this way, if you want to go your local Starbucks, just knowing the name of the shop will not get you there, you will need to know which street it is on and the unit number to get to the place. Same with getting to a website. When you enter the website address in a browser, it will first query the DNS servers and then locate which web server it is hosted on before sending a request to it and getting back the result to your web browser. All these happens in a matter of milliseconds but there is a lot that happened under the hood. If you want to know more, check out http://computer.howstuffworks.com/dns.htm
When you sign up for a virtual web hosting account, the web host will typically let you use their DNS Servers so all you need to do is to enter the details at where you got your domain name from and everything works from there typically within the next 24 or 48 hours. Typically it will be something like ns1.webhost.com and ns2.webhost.com. If you move from one hosting plan to another, typically the web host will either provide you with a new set of DNS Servers address or depending on how the DNS Servers are configured, you may not need to do anything and the same magic happens.
Some web hosts would host individual DNS servers on the very machine that host your website so moving from one server to another will require you to change the DNS Server entries. This method ensures that each server only contains the directory of the sites on that machine so if the server goes down, only all the websites on the machine is inaccessible. The other web sites on the other servers are not affected. However moving from one server to another can be a pain as the DNS may take several hours to days to populate internationally. It’s like having to update all the entries in all the address books globally.
Other web hosts may host them on a separate machine so the DNS Server address is always the same but they will change the IP address to your website in that database. The plus point is that moving a website from one server to another within the web farm is easy as the web host will just need to update the IP address after the shift in the DNS server and the change is almost instantaneous as only the local directory needs to be updated. The pitfall is when the DNS Server goes down then every single website under the web host control also goes down.
Moving web sites from one location to another is no different from moving house. There is a lot of planning involved to ensure that everything ends up smoothly. The difference between moving house and moving a website particularly between web hosts is that with the website, we can basically mirror the contents over, make the switch in the DNS servers, keep both sites up and wait 72 hours before shutting down the old web hosting account and everything be done.
The reason why we should keep both sites up (new and old) is that during the DNS updates globally, not all global DNS Servers will get updated at the same time, they will poll at different timing and it takes times to populate every one of them. So during that time, you get some traffic coming to both the new and old web host. Actually it might bounce between the two from time to time even on your machine. What I will do is make a minor change on the web site in the new server and monitor the change. At times the new website will show up and later the old one will show up. Typically 72 hours everything should work if everything is configured correctly.
Knowing that I might move the web sites in the future, I no longer use the web host’s DNS Servers. It is a good thing that now domain name registrars do provide the use of their DNS Servers and there are independent services such as DNSMadeEasy and Dyn.com which provides the option to use their DNS servers for free or for a fee. Usually the paid services have other value added service which allows you to switch to an alternative server if the main one is down so as to ensure perpetual uptime or to move some traffic to an alternative web server to balance the traffic load.
I am using my web host DNS Servers and that makes shifting website a whole lot easier. Since I would not change my Domain Name Registrar, they can be my constant in the whole shift. Each time I move web hosts, I just update the IP address in the A entry and it is done.
The A Record in the DNS Entry is what you will need to take note. The Value will be the IP Address of your web site or web server. This will be provided to you when you sign up with your web host after the web hosting account is set up or if it is not provided, you can ask for it. The TTL or Time to Live is how often the entries will be checked and updated. When everything is nice and done, you can keep it as 3600 seconds or an hour but during the move, keep the TTL as low as possible so that the entries get updated faster.