VOOZH about

URL: https://www.digitalocean.com/community/tutorials/how-to-configure-dns-round-robin-load-balancing-for-high-availability?comment=26967

⇱ How To Configure DNS Round-Robin Load-Balancing For High-Availability | DigitalOcean


How To Configure DNS Round-Robin Load-Balancing For High-Availability

Published on February 21, 2014

By O.S. Tezer

👁 How To Configure DNS Round-Robin Load-Balancing For High-Availability

Introduction


Albeit one of the more controversial techniques, a good method to geographically distribute your application by taking advantage of your provider’s global presence is to use and manage DNS responses (i.e. list of IP addresses returned). Unless you are willing to spend a little fortune on hardware and infrastructure costs, working with DNS to achieve high-availability is probably an excellent way to go.

In this article, we will see how to exploit some of the truly excellent and unique possibilities offered by DigitalOcean’s global cloud server / data-centre infrastructure to have a geographically-distributed, highly-available application set-up for minimal downtime (and thus dataloss) by managing DNS responses.

Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.

Learn more about our products

About the author

👁 O.S. Tezer
O.S. Tezer
Author

Still looking for an answer?

Was this helpful?

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Thank you for this tutorial. Would you be kind enough to also add the setup for replication of files please? many thanks

Good article, but I am confused by the diagram.

  1. I need a load balancer droplet for each of my application droplets?

  2. Is the diagram using a master to master database?

I want to load balance my application, and my application should write to the master db and read from a load balanced slave. Can you point me in the right direction for that ?

I must be wrong because it looks to me like I need the following 9 servers to make it happen.

Server 1: Application load balancer 1 Server 2: Application load balancer 2 Server 3: Application Server 4: Application Server 5: MySQL master to handle writes from Server 3 and 4 Server 6: MySQL Slave Load Balancer 1 Server 7: MySQL Slave Load Balancer 2 Server 8: MySQL Slave Server 9: MySQL Slave

Probably we need when users grow exponentially

One sentence in this article is a huge lie and makes proposed solution unusable:

“When a web-browser requests a web-site, it will try these IP addresses one-by-one, until it gets a response.”

No, it doesn’t! Browser selects the random IP address and sticks to it no matter if the host is up or not! DNS round-robin is not a failover solution! What you say is only true for MX records and mail servers.

If you want to have a spare load-balancer, you need to implement a solution that will make it capture original IP address of failed one. I guess there is no way to use DO droplets for this. So - if any of your load balancers will be down - half of your visitors will see error message.

To proof my words: I setup a dns entry test1.pr1v.net which has 3 records:

test1.pr1v.net has address 1.2.3.5
test1.pr1v.net has address 78.47.31.86

Two of them (1.2.3.*) are unused addresses, and the third one is my host IP. Please see if the site works for you everytime you try. I bet not.

* Rebuilt URL to: http://test1.pr1v.net/
* Hostname was NOT found in DNS cache
* Trying 1.2.3.5...

@mateusz : Same is happening with me . DNS load Balancing does not work on the digital ocean side. Randomly it sticks to one IP and keep on calling the same, no matter what the situation is(doesn’t even change for failover) . :(

This looks a very conventional solution. Whether it works or not purely depends on if digitalocean’s DNS system does failover or not. can you confirm that?

Without this ability, DO’s dns can have still have chance to send back dead reverse proxy’s ip back to user, hence resulting in a no-responding/freezing web site or app.

Please, can someone from DO confirm that?

If i don not need load balancing (because each of the two servers can easily handle all my traffic) but i want to have a fall-over-server in case one of the servers is unreachable; can i then skip the load balancer proxies and just put the application servers in the dns?

I too would like to know if DigitalOcean DNS zoning provides health checks for server endpoints.

Currently, I’m using Amazon Route 53 for this purpose…

Essentially this misses shared state servers (most DB’s are too slow for this)

👁 Creative Commons
This work is licensed under a Creative Commons Attribution-NonCommercial- ShareAlike 4.0 International License.
  • Deploy on DigitalOcean

    Click below to sign up for DigitalOcean's virtual machines, Databases, and AIML products.

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and AI-native businesses

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

© 2026 DigitalOcean, LLC.Sitemap.
Dark mode is coming soon.