How dynamic response works

Gcore’s DNS server can provide different DNS responses to different users. For example, you can specify that particular records will be delivered to users in Asia versus users in Europe, or choose the weight for the records, i.e., the probability with which they will be shown in the responses. This is called dynamic response. Depending on which parameter is used to select which record will be shown, it may also be referred to as weight balancing, traffic steering, GeoDNS, or failover.

Pickers are used to control dynamic responses. They determine in what order the DNS query data will be checked and compared with the metadata set for the particular record.

Dynamic response makes the RRSet dynamic. You can add several records and determine which one will be in DNS responses depending on how the query meets the established criteria (e.g., user’s subnet or ASN, geo metadata, etc.)

Dynamic response setup consists of two stages:

  1. Set the metadata or other data types against which the query parameters will be compared.
  2. Select pickers to define the sequence in which the resolver will compare the query data for your record and check for matches against the metadata or other criteria of the specified record.

For example, you can set the “Continent” picker and add metadata of the “continent” type with the value “Africa”. The result is that the record will only be retrieved for users located in Africa.

Configure dynamic response

1. Create a DNS record set in the advanced mode (steps 1–4.)

2. Enable the Dynamic response toggle.

3. Select a picker preset from the “Presets” buttons or manually choose pickers from the list on the right. The order of the pickers in the left list dicatate priority: the top picker will be considered first, the second picker considered second, and so on.

Tip

Presets are editable: You can select a preset and then change the position of pickers or add/remove pickers manually.

Adjust pickers as follows:

  • To raise or lower a picker, use the drag-and-drop method.
  • To remove a picker, click the cross.
  • To remove all selected pickers, click Clear.

4. Specify the record’s value.

5. Set appropriate metadata to which the value in the query will be compared and specify the value. You can add several metadata fields for one value by clicking the plus button.

6. Click Add record to add several records to your response and repeat steps 4 and 5.

7. Click Create.

That’s it. You’ve configured dynamic response for your DNSset.

Examples of preset settings

With the “Geo DNS” preset, you can add metadata of different types to each record.

Warning

The latlong and weight metadata will be ignored if you don’t add the corresponding pickers from the list.

When a DNS request is made, the response will be formed using the chosen “Records selection” option and metadata specified for records.

Our system will check if a user matches the criteria from the metadata in the following order: IP, ASN, country, and continent. The processing logic works like this:

  1. Gcore’s DNS server receives a request to the domain.
  2. If Health Checks are configured, we filter off all “non-healthy” records.
  3. Gcore’s DNS server compares the requestor user’s IP (respecting EDNS(0)) with the IP from the metadata. The server uses records with matching metadata to form an answer if possible.
  4. If no matches are found, the ASN meta is considered as in step 3.
  5. If no matches are found, the country meta is considered as in step 3.
  6. If no matches are found, the continent meta is considered as in step 3.
  7. If no matches are found, the region meta is considered as in step 3.
  8. If no matches are found, the records with “fallback=true” metadata are considered.
  9. If no matches are found, all records are used in the answer (respecting the max answers value.)

Example : You selected the “Geo DNS” preset, specified one record per response in the First N.

Then, you added two records with IP metadata:

  • For 10.0.0.0 record, subnet 192.168.1.0/24
  • For 10.0.0.1 record, subnet 192.0.2.0/24

If a user with the IP from the subnet 192.168.1.0/24 requests the domain, the record with the value 10.0.0.0 will be returned. If the requestor’s subnet is 192.0.2.0/24, the 10.0.0.1 record will be returned.