Mobile app version of vmapp.org
Login or Join
Gail5422790

: Can I manipulate the DNS protocol to host websites across multiple servers and direct users to the geographically closest? Let's pretend that I'm hosting a very big and popular website. Let's

@Gail5422790

Posted in: #Apache #Dns #Server

Let's pretend that I'm hosting a very big and popular website. Let's also pretend that I have many web servers spread out all around the world. Each web server containing identical files.

If I make my own DNS daemon, could it give different records out depending on the ISP asking for the records, therefore, giving each user direct access to a web server much closer to them?

10.04% popularity Vote Up Vote Down


Login to follow query

More posts by @Gail5422790

4 Comments

Sorted by latest first Latest Oldest Best

 

@Pope3001725

Yes this is possible provided that your DNS daemon has the capabilities to provide the closest web server IP based on requesting client IP. Not a typical DNS daemon deployment that's for sure.

Found two links on configuring BIND to accomplish what you're looking for:


HOWTO Implement GeoDNS using BIND - scripts for configuring BIND to be GeoIP aware.
Geolocation-aware DNS with Bind - configuring BIND views.


Many Content Delivery Networks (CDN) such as Akamai have this capability. What makes them even better is they perform health checks on the destination service. This ensures the client will be directed to a service that is available and that will provide the best performance.

10% popularity Vote Up Vote Down


 

@Courtney195

Use Round-robin DNS or a load balancer.

10% popularity Vote Up Vote Down


 

@Pope3001725

If you want to direct users to the closest server to them using only DNS then i would recommend setting up a couple of cheap VPS's you can use to host your own DNS in different geographical locations.

DNS round robin isn't really a great way to do geo location based load balancing because if you have multiple A records with different IP addresses the DNS server will merely alternates the order of the address records each time a name server is queried.

Therefore you could have a DNS server in North America resolve your A record to your web server in North America while having your DNS server in Europe resolve your A record to your web server in Europe. (These locations are just an example, the point is having your DNS servers resolve your A records to your web server that is closest to that specific DNS server)

This is because a client should be using the DNS server that is closest to them, you can read more about how a client chooses the closest/fastest nameserver to use here - superuser.com/questions/527116/how-does-my-browser-locate-the-nearest-dns-root-servers
This should give you the outcome you desire while only using DNS servers but there are load balancing commercial services that exist that would be a lot more elegant.

10% popularity Vote Up Vote Down


 

@BetL925

No need to manipulate the DNS protocol. You can simply add multiple A records with different IPs. The DNS server will return the various A records in random order, thus your users will be distributed randomly across the various IP addresses.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme