3

Let's say:

  • I have a website written in English and shown on www.example.com.
  • The website is on a US server now (based on cPanel/WHM) at the IP address 192.0.2.0.
  • I can manage the DNS of example.com using a control panel to add/modify any records: A, MX, etc. (Currently, all A records are obviously pointing to 192.0.2.0.)

I would like that when a person in the US visits www.example.com the website is shown by the server in US, but when a person in Europe visits, the website is shown by a server in the UK.

  1. Is this possible using the same domain (with no sub domain redirections such as us.example.com and uk.example.com) by simply adding/modifying DNS records?

  2. If (1) is YES, how do I set up the DNS records of www.example.com in order to accomplish this?

  3. If (1) is NO, are there other solutions available to accomplish this, and what are these solutions?

TRiG
  • 1,167
  • 2
  • 13
  • 30
Marco Demaio
  • 580
  • 1
  • 8
  • 22

1 Answers1

2

You can use Anycast DNS to achive what you want.

That way people living in the USA will get the reply from an USA DNS server there you can have your USA IP addres, who lives in Europe will get the response from an European DNS server where you can have the IP address of your European server.

You need an Anycast DNS provider to use it. For example http://dyn.com/

Stone
  • 6,941
  • 1
  • 19
  • 33
  • You can get nearly the same result if you use a DNS server what answers differently based on the source IP, for example: http://blog.geek.be/simple-cdn-setup-with-powerdns/ in this case the only problem is that the first time the client visits the server have to get the IP from the far DNS server, but after it caches the reply the following communication with the nearby server will be fast. – Stone Dec 11 '13 at 12:01