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 1.2.3.4 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:
Listen 80
…
NameVirtualHost 1.2.3.4:80
…
<VirtualHost 1.2.3.4:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
…
</VirtualHost>
and, for whatever reason, you now want ‘mydomain.com’ to point to 1.2.3.5 instead. you would modify the directives shown above as such:
Listen 1.2.3.4:80
Listen 1.2.3.5:80
…
NameVirtualHost 1.2.3.4:80
NameVirtualHost 1.2.3.5:80
…
<VirtualHost 1.2.3.4:80 1.2.3.5:80>
ServerName mydomain.com
ServerAlias www.mydomain.com
…
</VirtualHost>
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 1.2.3.4 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.
| bookmark it! | ||||||
|
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| « Nov | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | 30 | |||
One Response
Jay Moiron
January 29th, 2008 at 3:22 pm
1Hey Stumpy,
I’ve lost contact with you for a while, but it’s good to see you blogging (about tech stuff no less!). On the subject of DNS, when I was redoing some stuff on my servers DNS, I found checkdns.net’s dns checking script to be pretty useful.
– Jay
RSS feed for comments on this post · TrackBack URI
Leave a reply