WordPress DNS Load Balancing

By default, when you create a custom domain for your WordPress website, the DNS Round-Robin algorithm is used to resolve the domain name. This means that every time you resolve the domain name, you will get all the IP addresses registered for it, even the unreachable ones. This can lead to performance issues and downtime if one of the endpoints is not reachable. However, you can set up DNS load balancing to ensure that the traffic is routed to the healthy endpoints only. This can be especially useful for multi-region WordPress installations, where the website is hosted in multiple regions or data centers.

The DNS load balancing can provide several benefits, including:

  • endpoints health checks
  • smart routing based on clients’ geographic location
  • latency evaluation to the endpoint

Below, we will provide a step-by-step guide on how to set up DNS load balancing for your WordPress website at the Virtuozzo Application Management on the example of the CloudFlare DNS service. The same principles can be applied to other DNS providers, but the specific steps may vary.

1. In the Cloudflare dashboard, go to Traffic > Load Balancing > Create Load Balancer. Type the custom domain you have created the A records for. Make sure that traffic proxying is disabled (won’t go through Cloudflare) since we are going to balance DNS requests only.

traffic load balancer

2. The next step is to create origin pools. In our example, we have the WordPress cluster with two load balancers and two corresponding A records, so we will create two pools specifying one load balancer in each as origin. You may follow Cloudflare documentation or just specify the Pool Name and Origin Name as arbitrary values. Use the public IP address of one of the load balancers as the Origin Address, and since the load balancers are equal, set the Weight as 1. Scroll down and specify the Notification E-mail where you prefer to obtain the health check notifications.

create origin pool

Press the Save button. Repeat the same for the second load balancer.

3. After that, specify a monitor to carry out the health checks for each origin. Click the Attach monitor > Create a Monitor button.

create monitor button

4. The new monitor requires you to specify parameters to be used for health checks. However, be aware that some of them are dependent on your subscription and may cost extra. Follow the Cloudflare monitor tutorial for detailed instructions, or just specify parameters as follows:

create monitor

5. Save the changes and attach the monitor to the origin pool. Here, you can also specify the notification email address.

attach monitor

Attach the same monitor to the second origin. Ensure that both origins are healthy before proceeding to the next step.

attach second monitor

6. The next step is to select the Traffic Steering option to define the load balancing algorithm. Available options may depend on your subscription plan:

  • Off (standard failover algorithm) – routes traffic from the unhealthy pool to the next healthy one.
  • Random – routes traffic a healthy pool at random.
  • Dynamic steering – routes traffic to the fastest pool based on latency measured during health check results.
  • Geo steering – routes traffic to the pools based on the client’s region or point of presence. You can specify the pools to which the load balancer should direct traffic for a given geolocation or point of presence. Several pools can be configured to the same region, and the balancer will use them in failover order.
traffic steering

In our example, we have two load balancers in the same region (not a multi-region cluster), so we will use the Off option.

7. Lastly, review the settings and click Save and Deploy.

review and deploy

Congratulations! Now, your website is maintained via a DNS load balancer.

Let’s check if the DNS load balancing works properly. To do this, we’ll simulate a server failure and see if the traffic is routed to the healthy endpoint. You can follow the steps below directly from the Virtuozzo Application Management dashboard by connecting to one of the load balancer nodes via Web SSH.

1. Check that all endpoints configured in the previous section are returned when resolving the custom domain name. Use the following command to check the DNS records:

1
dig wordpress-enterprise.jele.website +short

2. Stop load balancer service in one of the containers to imitate server failure:

1
sudo jem service stop

3. Wait 60 seconds to make sure the health check interval is expired, then check the following:

  • verify the application’s operability in a web browser
  • try to resolve the custom domain name once again – the healthy endpoint should be returned
failover resolve IP
  • check your domain registrar to see if the DNS records have been updated
failover DNS records
  • if you have set up email notifications, check your mailbox for the appropriate alert
failover email alert

4. Don’t forget to restore the load balancer service after the test:

1
sudo jem service start

5. Wait for 60 seconds and check the health state of the origin in the same way as described above. The healthy endpoint should be resolved and reachable again.

healthy endpoints

6. If necessary, you may adjust load balancer features after the test:

  • Origin Servers – number of origin servers
  • Faster Checks – health check interval
  • Check From – number of regions the health checks can be performed from
  • Traffic Steering – traffic routing algorithms
adjust load balancer features

Congratulations! You have successfully set up DNS load balancing for your WordPress website at the Virtuozzo Application Management. Now, your website is more resilient to server failures and can handle traffic more efficiently.

Share this:
FacebookXWhatsAppTelegramLinkedInGmailCopy Link
Updated on March 10, 2026
Was this article helpful?

Related Articles

Need Support?
Can't find the answer you're looking for?
Contact Support