How to perform a load balance between DNS records

You can use an Edge DNS zone to create multiple records and perform a DNS load balance. Assigning different weights to each record for the same zone helps distribute incoming network traffic, ensuring optimal resource utilization and preventing overload on a single server.

In this guide, you’ll learn an example using a record type A, which accepts values of IPv4 address format.


  1. Access Azion Console > Edge DNS.
  2. Choose the zone in which you want to add records from the list or create a zone.
  3. Select the Records tab.
  4. Click the + Record button.
  5. In Name, provide the new record’s name as a subdomain.
  6. In Type, select the type of record A.
  7. In Value, add the items for the DNS response to the registered record in IPv4 address format. Example: 192.111.0.1.
  8. In TTL (seconds), choose the time, in seconds, that a response can be cached on a resolver server. Maximum value: 2147483647.
  9. In Policy, select Weighted.
    • In Weight, specify the weight for the record, considering that you’ll create other records for the same zone with different weights. Accepts values from 0 to 255.
    • In Description (optional), you can add a short text that differentiates the records you’ll create for the load balance. Accepts up to 45 characters.
  10. Click the Save button.
  11. Repeat steps 4 to 10 to create the other balanced DNS records needed while observing Edge DNS limits, always using the same Name and setting the desired addresses in Value and weights for each record in Weight.

If you add 3 records, you can, for example, specify a weight of 50 for the first record, 20 for the second record, and 30 for the third record.


Testing your balanced record

After configuring your balanced record, you can test and see if it’s working via terminal commands:

  1. Run dig +short [your balanced hostname] a couple of times in a row.
    • You’ll see the address list vary based on the record selected by the Edge DNS load balancer each time.
  2. The response will be similar to:
Terminal window
dig +short lbexample @ns1.aziondns.net
192.111.0.1
Terminal window
dig +short lbexample @ns1.aziondns.net
192.111.0.2
Terminal window
dig +short lbexample @ns1.aziondns.net
192.111.0.3


Contributors