Re: dns management / site mirroring

From: x-opensrs-lists@szarka.org
Date: Tue May 27 2003 - 10:24:15 EDT


At 05:52 AM 5/27/03, you wrote:
>Say, I have two web servers, one in USA, another one in Singapore, both
>displaying exactly the same content (mirror). Can it be done so that users
>in Singapore would automatically connect to the server in Singapore and
>users in US would reach the server is US?

There's no way to tell where in the world a web site visitor happens to be
sitting, but you can use their IP address to make a pretty good guess: if
the address reverse-resolves to something ending in ".sg" or their IP
address was allocated by the appropriate regional registry, then it's a
decent guess that they're from Singapore.

One approach would be to have your DNS server hand out different addresses
based on the IP of the client making the request. Another would be to have
a web server at, say, www.foo.com redirect requests to, say, sp.foo.com,
us.foo.com, etc. as appropriate.

In the case where the content of both servers is the same, the DNS-based
approach is appropriate. The location of the requesting DNS client is
probably a less precise measure than looking at the IP of a requesting web
client, but not terribly so. And it doesn't matter as much if you guess
wrong, because they will see the same content either way. I chose to
implement the web server redirect approach because my project required
serving different content to visitors in different locations. It also
gives me the flexibility to let visitors choose to use a different regional
site and remember that choice with cookies so they get redirected to the
same server in the future.

I offer the web-based redirection as a hosted service. If there were
demand, I'd consider rewriting the code and licensing it.

-- 
Rob Szarka
"Reality is what you can get away with." - R.A.Wilson



This archive was generated by hypermail 2.1.3 : Tue Oct 19 2004 - 23:37:42 EDT