gtm dns-record
The gtm dns-record command manages the DNS records of a domain name: the type and the name of the record, the addresses to be returned, the health state of the addresses, with which algorithm the answer will be produced and the fallback records that will come into play while all the addresses are unhealthy. Its panel equivalent is the Records screen.
The record is bound to two upper records
This command first asks in which DNS service (dnsId) and then in which domain name (domainId) it will run. Both of them are selected from the list with Tab. The domain name is created with gtm dns-domain.
Command Summary
Required Fields
| Order | Field | Status | Value |
|---|---|---|---|
| 1 | dnsId | Required | The DNS service to which the record will be added |
| 2 | domainId | Required | The domain name to which the record will be added |
| 3 | type | Required | The DNS record type (A, AAAA, CNAME, MX, TXT, SRV, NS, PTR, CAA, TLSA and the others; 35 types in total) |
| 4 | name | Required | The record name, for example www |
| 5 | dcSelector | Conditionally required | Only if the mode of the domain name is Datacenter; the sorting criterion. Its options depend on the --dcSelectorSrc value; if there is a field that starts with -- on the line, it is written in the --dcSelector form, after the source |
The list, show, update and delete commands also ask for dnsId first: in the show and delete commands the identifier is written after this without the field name, and in the update command it is in the id <id> form.
The --ttl field is optional and its default is 3600 seconds.
The Addresses and the Health State
The addresses the record will return are written inside the data center groups. Every group takes its own index, and every address its own index within the group.
| Field | Default | Value |
|---|---|---|
--recordConfig.0.dcId | Yerel veri merkezi | Grubun veri merkezi |
--recordConfig.0.records.0.content | — | The address to be returned; it is written according to the record type |
--recordConfig.0.records.0.weight | 1 | The weight of the address; it is used only in the weighted algorithms |
--recordConfig.0.records.0.cond | true | The health state of the address |
The cond field takes one of three values:
| Value | Meaning |
|---|---|
true | The address always counts as healthy and takes part in the answer; a health check is not done |
false | The address always counts as unhealthy and takes part in no answer |
| A health scenario | While the scenario is active the address takes part in the answer, while it is passive it does not |
There has to be at least one address in every group. The scenarios are created with gtm scenario.
The Distribution Algorithm
| Field | What it does | What is written after it |
|---|---|---|
--balanceAlgorithm | Determines which of the healthy addresses will be returned | One of the values below (the default is all) |
The behavior of the values:
| Value | Behavior |
|---|---|
all | It returns all the healthy addresses (the default) |
1 · 2 · 3 | It returns the first one, two or three healthy addresses |
rr | It makes a sequential distribution among the healthy addresses |
wrr | It makes a sequential distribution according to the weights |
random | It selects randomly from the healthy addresses |
wRandom | It selects randomly according to the weights |
closest | It returns the address geographically closest to the client; it is effective only in the A and AAAA records |
When the weighted algorithms are selected, the weight values of the addresses are used.
The Fields That Change According to the Mode of the Domain Name
The fields the record command will ask for change according to the operating mode of the domain name it is bound to.
If the domain name is in the dr mode
| Field | Default | Value |
|---|---|---|
--drCond | — | The health scenario that triggers the switch to the backup center |
--drIfNoRecords | true | Provides that it is switched to the backup when no healthy record is left in the main center as well; it is seen only while a switch scenario is defined |
If the domain name is in the dc mode
| Field | Default | Value |
|---|---|---|
--dcSelectorSrc | static | The source of the sorting criterion: static · dcHost · service · client |
dcSelector | — | Conditionally required The sorting criterion; its options change according to the source |
dcServiceName | — | Conditionally required Only while the source is service; the name of the service to be measured |
--pickDcCount | 1 | From how many data centers the answer will be selected |
The values of the dcSelector field according to the source are as follows:
dcSelectorSrc | The criteria that can be selected |
|---|---|
dcHost | cpu · mem · bw · status · packetLoss |
service | cpu · mem · bw · request · connection · session_new · status · healthyBackends |
client | hops · mos · packetLoss · ttl |
The Fallback Records and the Topology
| Field | Default | Value |
|---|---|---|
--fallbackRecords.0 | Empty | The fallback addresses to be returned while all the addresses are unhealthy; they are returned under every condition, without a health check being done |
--topologySelection | false | Turns on the addresses being selected according to the source of the client |
The topology rules are not defined on the command line
The --topologySelection only turns the feature on. The defining of the address-based rules (the network, the country, the continent, the autonomous system number) is done from the panel.
Examples
Updating and Deleting
Things to Know
- The mode of the record comes from the domain name. The record does not select its own mode; which fields will be asked for is determined by the operating mode of the domain name.
- The fallback records are not checked. When all the normal addresses are unhealthy, they are returned unconditionally; this is suitable for a maintenance page or for the address of a backup load balancer.
- The geographic selection works only in the address records. The
closestalgorithm behaves, in the types other thanAandAAAA, likeall. - The weight is effective only in the weighted algorithms. When
wrrorwRandomis not selected, theweightvalue has no effect on the result.
