Bunny DNS allows you to configure complex global load balancing with built-in health monitoring, weights, and smart queries. This article contains the information to help you better understand how the load balancing works, and ties together different systems of Bunny DNS.
Every A and AAAA record created in Bunny DNS allows you to configure a Routing Weight setting with a value between 0 and 100. This setting controls the relative weight of the record in relation to other records within the record set. It will control how often the record is returned to DNS queries compared to other records.
For example, if a record set contains two records first one with a weight of 100, and a second one with a weight of 50, the first record would be included 2/3 of the time, while the second one would be included 1/3 of the time.
This allows you to split the load between different servers according to their computational power.
If all records have the same weight, up to 3 records will be randomly returned from the record set. If records have different weights, a single record will be selected based on a weighted Round Robin system.
Understanding Load Balancing Smart Records
The Bunny DNS load balancing system works together with Smart Records to allow smart global request distribution. When a record set is created with smart records, each set of unique coordinates within a DNS record set would create a subset of records for the query.
This means if two records are configured with a geo-location in Los Angeles, and two records are configured in Tokyo, a DNS query from Tokyo would only work with the two queries configured with the matching geo-location in Tokyo when determining weights and status monitoring.
If all records within such a subset are offline, the query will then process the next closest region instead.
Integration With Bunny CDN
The One-Click CDN proxy setting allows you to convert the DNS-based load balancing into a powerful CDN-based global load balancer. When full-site acceleration is enabled through the CDN Proxy, the CDN will automatically understand the load balancing configuration of the record set.
This includes weights, uptime monitoring, and smart record configurations such as location-aware records. If the record set is configured with geo-locations, the CDN will automatically connect to the closest region to the CDN edge server.
If a record is detected as offline, the CDN proxy will no longer attempt to connect to it and will instead fail over to other records within the set.
Scriptable records are not supported when setting up Bunny CDN integration.
Understand Health Monitoring
If the DNS record monitoring is enabled on a record set, additional logic is added to the load balancing system that prevents offline records from being returned.
What will happen during load balancing depends on the number of records within the group. If the record has a single value, nothing happens and the system will continue to return the record value. If the record is part of a group of DNS records with the same type and domain, offline records are removed from the routing and will not be returned as part of the DNS responses to queries.
If all the records in a group are detected as offline, the system will not filter records based on online status. This prevents false positive detections from incorrectly marking the whole system as offline.