That's not a function of DNS or a DNS server. That's what a load balancer is for, whether it's a simple one on a local network, or a global load balancer (GSLB).
I'm not aware of any open source or free GSLB's. It wouldn't be too difficult to script something on your own. But basically GSLB's run a DNS server in them, but behind the scenes they continuously query and check the health of multiple remote sites, and also return IP addresses based on where the user is coming from.
█ 01 Networks / Hosting and Consulting Services
█ Pay as you Go hosting -- the cheapest prices in town.
█ Zimbra (Network Edition and Open Source) Hosting
█ 100% full uptime guarantee / 24x7x365 support