DNS round-robin load-balancing
You can make GSLB return several IP addresses from healthy datacenters in a round-robin weighted fashion.

First client | Second client | ||
---|---|---|---|
I | A client asks for the IP address associated with the www.example.com domain name. | A | A client asks for the IP address associated with the www.example.com domain name. |
II | GSLB returns a healthy IP address from the pool of available addresses. | B | GSLB returns the next healthy IP address from the pool of available addresses, in a round-robin fashion. |
III | The client connects to the IP address. | C | The client connects to the IP address. |
-
In the Services tab, click gslb setup.
Add a
listen
directive for each IP address/network port pair at which the GSLB should listen for DNS queries. By default, it listens on all IP addresses (0.0.0.0) at port 53.To enable the service to start automatically when the appliance boots, delete the no autostart line, click OK and then Close.
-
In the Services tab, click [advanced mode], then edit the gslb configuration.
The current configuration displays.
zone example.com ttl 10 # ORIGIN records record @ SOA ns1.example.com hostmaster.example.com 1 86400 3600 3600 3600 60 record @ NS ns1.example.com record @ ttl 3600 MX 100 mail1.example.com # Static records record ns1 ttl 20 A 10.0.0.1 record mail1 ttl 20 A 10.0.0.2
-
Add a new
list
record to thezone
section.The
record
section directives syntax is as follows.Record type
Description
list
Dynamic record followed by list of space-separated
answer-list
names.The list record www contains one
answer-list
: dc1.zone example.com ttl 10 # ORIGIN records record @ SOA ns1.example.com hostmaster.example.com 1 86400 3600 3600 3600 60 record @ NS ns1.example.com record @ ttl 3600 MX 100 mail1.example.com # Static records record ns1 ttl 20 A 10.0.0.1 record mail1 ttl 20 A 10.0.0.2 # Dynamic records record www ttl 20 list dc1
-
Create
answer-list
sections that match the names you listed in thezone
section.zone example.com ttl 10 # ORIGIN records record @ SOA ns1.example.com hostmaster.example.com 1 86400 3600 3600 3600 60 record @ NS ns1.example.com record @ ttl 3600 MX 100 mail1.example.com # Static records record ns1 ttl 20 A 10.0.0.1 record mail1 ttl 20 A 10.0.0.2 # Dynamic records record www ttl 20 list dc1 answer-list dc1 method single-rr option httpchk http-check connect http-check send uri
/health.htmlhdr host www.example.com answer-record srv1 20.0.0.1 weight 10 answer-record srv2 20.0.0.2 weight 20The
answer-list
section directives syntax is as follows.Directive
Description
method
Set the
single-rr
parameter.option
Specify
httpchk
to monitor the health of servers.http-check
Set any relevant health check parameters.
answer-record
Enter any number of
answer-record
directives along with the corresponding IP addresses. Weights determine how often a particular IP address will be returned, with higher weights being chosen more often.By specifying
method single-rr
, HAProxy ALOHA alternates which IP for a datacenter it sends to clients in order to distribute traffic across all servers. In that case, the odds of a server's IP being returned is server weight / sum of all server weights. -
Save your configuration, close the configuration editor, then apply your changes on the gslb line in the Services tab.
In the Setup tab, click Save under Local Configuration to persist your changes after a reboot.
Next up
Geolocation-based load balancing