Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I have a domain-name, and I want to host the website on two servers. One server is located in Europe and one in Asia. How can you route European people to the European server and Asian people to the Asian server?

I want to do this, because if you access a European website in Asia it's very slow and visa versa. I know/think some big websites are doing this too (like Google, Facebook, etc.).

Is it possible to do this? Or is there another way to manage this problem? And I'm not thinking of two domainnames.

share|improve this question

migrated from stackoverflow.com Apr 19 '11 at 11:15

This question came from our site for professional and enthusiast programmers.

4 Answers 4

up vote 2 down vote accepted

You can use a DNS server that returns the IP address that is closest to the requesting IP address.

I have never used such a service, but the Server Fault post Geo-DNS providers? discusses many providers.

share|improve this answer
    
I think this is a helpfull link. And another option is, as suggested in the link, to use different subdomains for the regions. –  Yoni Apr 20 '11 at 7:05
    
I couldn't find the link when I answered but this one geoscaling.com is free and I have heard good things about. Sub domains is easier and can be done with "normal" DNS but they will be seen as separate sites by search engines so very bad for SEO. –  ollybee Apr 20 '11 at 9:11

Yoni, large companies do this with DNS load-balancing appliances like Cisco's Global Site Selector.

share|improve this answer

I would investigate multiple A records in the DNS. It appears that may do what you want. It is worth researching.

share|improve this answer
    
I will investigate this option but I don't think it is going to work because of what I've read it only changes the IP if the other IP is unavailable or if you have multiple requests when loading a page he switches between the 2 IP's. –  Yoni Apr 20 '11 at 7:04

Easy, just put script ip detect geolocation in your header index.php. Example: if IP from asia, redirect to asia.yourcompany.com else redirect to www.yourcompany.com

Yahoo will redirect to id.yahoo.com if visitors from Indonesia :)

share|improve this answer
1  
DNS and routing before users hit your web server is much faster. Your method relies on the web servers application to manage routing. That means if you had millions of visitors your web server is getting hit 1 time from each then redirected to the next web server. It's not an ideal method, Amazon Web Services has some pretty simple to use load balancers. –  Anagio Feb 28 '12 at 7:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.