2

Is it possible in this world to achieve DNS Level Load Balancing? For example, I have a Server A (111.222.333.444) and Server B (555.666.777.888), and there be some third party DNS hosting (like CloudFlare) which could decide if Server A is down (or not responding) then divert all traffic to Server B. This is not a true load balancing, rather a traffic diversion, I don't know. But is it possible?

I know DNS propagation takes time, but services like CloudFlare barely take a few minutes to divert to other server.

Any ideas? Thanks.

6

DNS can very well be used for load balancing, but it's only able to do things like simple round robin.

If you want to implement something like a high availability solution in DNS, you'll have to disable IPs that are unavailable, for which you would need to set the TTL to some minimum value, which is not a good idea.

In general its a much better idea to use solutions like Heartbeat.

With Heartbeat, the scenario would look like the following:

You have Server A and Server B. Heartbeat is checking continuously if Server A and B are OK. If Heartbeat detects that Server A has a problem, it simply assigns Server A's IP to Server B. So then Server B is serving the requests for both IPs.

That way, for the user, there is only a minimal service interruption of a second or two that heartbeat takes to reassign the IPs and propagate the updated ARP. That is much faster than you could ever propagate a DNS change.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.