Skip to content

ALIAS, GSLB and overrides with Terraform

DTM’s global server load balancing (GSLB) features, ALIAS records and override records, are both manageable as code.

An ALIAS record is a dtm_record with type = "ALIAS" whose values are downstream hostnames rather than IP addresses. DTM resolves those hostnames at query time, health-checks the addresses behind them, applies the load-balancing policy, and returns flattened A/AAAA answers. ALIAS records can sit at the zone apex.

resource "dtm_record" "app" {
zone_id = dtm_zone.example.id
name = "app" # or "@" for the zone apex
type = "ALIAS"
ttl = 30
values {
value = "app-ne.contoso.com"
region = "northeurope"
}
values {
value = "app-we.contoso.com"
region = "westeurope"
}
lb_policy {
method = "region"
}
health_check_template {
protocol = "https"
port = 443
path = "/healthz"
interval_seconds = 5
}
}

This steers each client to its own region and fails over across regions automatically. The region on each value is optional; DTM can infer it from the resolved address using your subnet mappings.

See health checks and load balancing for the full lb_policy and health_check_template schema, including authenticated probes.

An override record (dtm_override_record, role: editor or admin) intercepts a single exact FQDN in a zone that DTM otherwise forwards, and answers it authoritatively with the same health-aware load balancing. Everything else in the zone keeps forwarding. Overrides are an advanced adoption ramp: admins can also manage them from the web UI behind confirmation guardrails, but Terraform remains the recommended steady state, and a Terraform-owned override should keep Terraform as its single owner (see the ownership rule).

resource "dtm_override_record" "api" {
fqdn = "api.corp.example."
type = "A"
target_mode = "linked" # "linked" = hostnames resolved at query time; "static" = fixed IPs
ttl = 30
values {
value = "api-ne.contoso.com"
region = "northeurope"
}
values {
value = "api-we.contoso.com"
region = "westeurope"
}
lb_policy {
method = "region"
}
health_check_template {
protocol = "https"
port = 443
path = "/healthz"
interval_seconds = 5
}
}
Attribute Required Description
fqdn Yes Exact FQDN to intercept, with trailing dot. Must not equal a DTM zone apex. Changing it replaces the resource.
type Yes A or AAAA. Changing it replaces the resource.
target_mode No static (default; literal IPs) or linked (hostnames resolved at query time, ALIAS-like). Changing it replaces the resource.
ttl No TTL in seconds.
enabled No Defaults to true.
values (block, 1+) Yes IP (static) or hostname (linked) values, with optional region.
lb_policy (block) No Same policy schema as records.
health_check_template (block) No Same template schema as records, including authenticated probes.

Pin a name to fixed addresses you control directly:

resource "dtm_override_record" "vip" {
fqdn = "legacy.corp.example."
type = "A"
target_mode = "static"
ttl = 60
values { value = "10.0.9.10" }
values { value = "10.0.9.11" }
lb_policy {
method = "failover"
}
}

Removing the override hands the name straight back to the forwarded zone, so adoption is fully reversible.

Terminal window
# ALIAS records import like any record: "<zone_id>:<record_id>"
terraform import dtm_record.app 8f3a...:c21b...
# Override records import by their ID
terraform import dtm_override_record.api 5d90...