i recently had cause to change the ip address associated with a certain domain name and wanted to find a way to experience zero downtime while the dns update went global…
let’s say you had a website ‘mydomain.com’ pointing at 188.8.131.52 in your dns records, and had set up a virtual host in apache accordingly. amidst other directives in your httpd.conf you would find these:
and, for whatever reason, you now want ‘mydomain.com’ to point to 184.108.40.206 instead. you would modify the directives shown above as such:
<VirtualHost 220.127.116.11:80 18.104.22.168:80>
by doing this, you’re telling apache to be aware of incoming requests at both ip addresses but to resolve both to a single virtual host. when the dns update is known to be worldwide, you can remove all references to the retired 22.214.171.124 address.
obviously this only pertains to a dedicated hosting environments that accomodate multiple ip addresses per host.
i see no reason why this same method could not be applied to achieve a similar effect when migrating from one hosting environment to another (assuming that the old and new ip addresses are available for you to use on both servers)… you would replicate the apache settings on the new server and once the dns update is complete you would then retire the old server and remove references to the old ip address on the new one.