views:

301

answers:

2

We want to switch hosting providers. To do so will require a DNS update for the IP address associated with our domain.

Content has been tested and brought up on the new server. The DNS update has been made but users are not able to see the new site until the DNS propagates (which could be days).

Is there a something that can be done on the old server so that if it receives a request, it can forward/redirect to the new server, thereby eliminating the 'DNS downtime'?

We are running ASP.net 3.5 on IIS6 with ISAPI_rewrite 3.0.

+1  A: 

You could setup a separate subdomain, redirecting users on the old server to that domain and have the new server accept requests from that subdomain. New subdomains (A records) should propigate much faster than changes. Once the DNS is fully propigated, you can just redirect that subdomain/A record to the regular address.

Darryl Hein
Darryl,I looked into this it makes a lot of sense. If it is a never-before-used subdomain, it will always be a DNS cache miss forcing a requery all the way to the dns root( i think). This may also cause a cache flush of the www (can someone verify?).
JWalker
Well, I could see it causing a DNS server to go look for updated records for the entire domain, but I'm guessing this would not be a general rule.
Darryl Hein
+1  A: 

Our solution (per Darryl's suggestion - but this is too much info for a comment)

We use ISAPI_Rewrite 3.0 which is a fantastic and low cost tool for url management so this solution is tailored to that product but conceptually should be valid for other environments.

DNS (for mydomain.com)

A   newsub  newIP #(new record)
A   existing newIP #(updated IP)

IIS Configuration for site at new Host:

Add newsub as a hostheader on site

.htaccess for site at new host

#add as first rule. trap requests for new subdomain and redirect to existing
#ASSUMES that redirect to existing is now safe because DNS for existing
#was updated when newsub DNS was queried.
#otherwise this is going to be an endless loop of 
#redirects between the old and new server
RewriteCond %{HTTP_HOST} ^newsub\.
RewriteRule ^(.*)$ http://existing.mydomain.com/$1 [R=302, L]

.htaccess for site at old host

#add as first rule. redirect all requests to new subdomain
RewriteCond %{HTTP_HOST} ^existing\.
RewriteRule ^(.*)$ http://newsub.mydomain.com/$1 [R=302, L]
JWalker