Configuration
dns-monitor reads a single YAML file at startup, by default ./config.yaml. Pass --config /path/to/file.yaml to override.
Top-level fields
Section titled “Top-level fields”| Field | Type | Default | Description |
|---|---|---|---|
interval | duration | 60s | How often every target is re-resolved. Accepts Go duration strings (30s, 5m, 1h). |
listen | string | :8080 | HTTP listen address for the dashboard. |
db_path | string | dns-monitor.db | Path to the SQLite history database. Created on first run. |
targets | list | [] | See below. |
targets[]
Section titled “targets[]”| Field | Type | Description |
|---|---|---|
name | string | Human-readable identifier. Shown in the dashboard and used as the primary key for MCP tools and history queries. |
host | string | Hostname to resolve. |
type | string | Record type. One of A, AAAA, CNAME, MX, TXT, NS. Case-insensitive. |
expect | list of strings | Expected answer set. A check is flagged if the resolved set diverges. Use an empty list (or omit) to skip drift detection. |
Type-specific answer formats
Section titled “Type-specific answer formats”The values stored in expect are compared against the stringified resolver output:
A/AAAA— IP literals, e.g.93.184.216.34,2606:2800:220:1:248:1893:25c8:1946.CNAME— the canonical hostname, trailing dot stripped.MX— the mail exchange hostname only (priority is not matched).NS— the nameserver hostname, trailing dot stripped.TXT— the raw string content of each record.
Example
Section titled “Example”interval: 30slisten: ":8080"db_path: "/data/dns-monitor.db"targets: - name: apex-a host: example.com type: A expect: - 93.184.216.34
- name: apex-aaaa host: example.com type: AAAA
- name: mx host: example.com type: MX expect: - .
- name: spf host: example.com type: TXT expect: - "v=spf1 -all"