Skip to content

Configuration

dns-monitor reads a single YAML file at startup, by default ./config.yaml. Pass --config /path/to/file.yaml to override.

FieldTypeDefaultDescription
intervalduration60sHow often every target is re-resolved. Accepts Go duration strings (30s, 5m, 1h).
listenstring:8080HTTP listen address for the dashboard.
db_pathstringdns-monitor.dbPath to the SQLite history database. Created on first run.
targetslist[]See below.
FieldTypeDescription
namestringHuman-readable identifier. Shown in the dashboard and used as the primary key for MCP tools and history queries.
hoststringHostname to resolve.
typestringRecord type. One of A, AAAA, CNAME, MX, TXT, NS. Case-insensitive.
expectlist of stringsExpected answer set. A check is flagged if the resolved set diverges. Use an empty list (or omit) to skip drift detection.

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.
interval: 30s
listen: ":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"