Define this in code. YAML format · Terraform
Config fields
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
config.hostname | string | Yes | — | Domain name to resolve |
config.recordTypes | array of string | No | ["A", "AAAA"] | Record types to query: A, AAAA, CNAME, MX, NS, TXT, SRV, SOA, CAA, PTR |
config.nameservers | array of string | No | ["8.8.8.8", "1.1.1.1"] | Custom nameservers to query, tried in order |
config.timeoutMs | integer | No | 1500 | Per-resolver timeout in milliseconds |
config.totalTimeoutMs | integer | No | 4000 | Total timeout for all queries in milliseconds |
Assertions
| Assertion | Required fields | Description |
|---|---|---|
dns_resolves | (none) | Passes if the hostname resolves at all |
dns_response_time | maxMs | Fails if resolution takes longer than threshold |
dns_response_time_warn | warnMs | Records degraded hint for elevated resolution time |
dns_expected_ips | ips (array) | Fails if resolved IPs don’t match expected set |
dns_expected_cname | value | Fails if CNAME target doesn’t match |
dns_record_contains | recordType, substring | Fails if record value doesn’t contain substring |
dns_record_equals | recordType, value | Fails if record value doesn’t match exactly |
dns_txt_contains | substring | Fails if no TXT record contains substring |
dns_min_answers | recordType, min | Fails if answer count is below minimum |
dns_max_answers | recordType, max | Fails if answer count exceeds maximum |
dns_ttl_low | minTtl | Fails if TTL is below minimum |
dns_ttl_high | maxTtl | Fails if TTL exceeds maximum |
Examples
Basic resolution check
monitors:
- name: Domain resolves
type: DNS
config:
hostname: example.com
assertions:
- config:
type: dns_resolves
severity: fail
Full validation with expected IPs
monitors:
- name: Production DNS
type: DNS
config:
hostname: api.example.com
recordTypes: [A, AAAA]
nameservers: ["8.8.8.8", "1.1.1.1"]
frequencySeconds: 300
regions: [us-east, eu-west]
assertions:
- config:
type: dns_resolves
severity: fail
- config:
type: dns_expected_ips
ips: ["203.0.113.10", "203.0.113.11"]
severity: fail
- config:
type: dns_response_time
maxMs: 500
severity: fail
- config:
type: dns_ttl_low
minTtl: 60
severity: warn
SPF record validation
monitors:
- name: SPF record
type: DNS
config:
hostname: example.com
recordTypes: [TXT]
assertions:
- config:
type: dns_txt_contains
substring: "v=spf1"
severity: fail
Next steps
DNS overview
When to use DNS monitors.
Regions
Available probe regions.