: 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
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?
More posts by @Gail5422790
4 Comments
Sorted by latest first Latest Oldest Best
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.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.