Premise: I'm facing an issue with load balancing with my own custom DNS server, over multiple web servers. My intention is to be able to quickly and dynamically switch the users I want between different servers by giving them new "A Records".
What I've tried: The current workaround is Using a Short TTL (1min), and temporary redirects from the old servers for the duration of that minute to the same subdomain but with a cache breaking value added to it. (s-00001.example.com -> s-0001-TIMESTAMP.example.com) But that solution is not efficient as it causes lots of needless DNS queries since I rarely need to do such a switcheroo! and it makes the old server that was already under some load, to not be fully alleviated of it since it still needs to serve the redirects for a minute.
But I have seen that when I respond with a 404 Error, Chrome and Firefox both will attempt another DNS lookup. so this will solve the problem, but still a 404 will interrupt the normal actions of my site for that one request. Also I have not tested this system with other browsers, and I do not think this is a feature Web Developers should depend on.
Question: I would like to know which status codes will provide the best results consistently over different browsers, and which ones make more sense. and also, if you have any other suggestions / workarounds, I'd love to hear them.
ps: I do know that DNS is not the best option for load balancing alone, but this is the current situation that I'm in.