Schedule icon
Request icon
Switch icon
SlackIncomingWebhook icon
Log icon

PowerDNS Authoritative Health & ServFail Sentinel

Audit PowerDNS authoritative statistics for servfail spikes, corrupt packets, and zone resolution health via Slack.

Categories
Infrastructure

Continuously monitors PowerDNS Authoritative Server deployments in real time, querying built-in webserver statistics to detect SERVFAIL response spikes, packet corruption surges, and zone backend disconnections before DNS outages degrade client traffic.

How it works

  1. periodic_dns_audit (io.kestra.plugin.core.trigger.Schedule) executes every 15 minutes, passing target host, API port, and threshold parameters through its inputs block. Shipped disabled by default to facilitate safe initial verification.
  2. probe_powerdns_statistics (io.kestra.plugin.core.http.Request) invokes GET /api/v1/servers/localhost/statistics with the X-API-Key header to retrieve live server performance metrics, including servfail-answers, corrupt-packets, and packetcache-hit.
  3. probe_powerdns_zones (io.kestra.plugin.core.http.Request) invokes GET /api/v1/servers/localhost/zones to verify backend database connectivity and confirm authoritative zone availability.
  4. classify_dns_health (io.kestra.plugin.core.flow.Switch) evaluates the probe responses:
    • SERVFAIL_SPIKE_DETECTED: Triggers when servfail-answers meets or exceeds max_servfail_threshold, dispatching a high-priority alert to #noc-alerts via io.kestra.plugin.slack.notifications.SlackIncomingWebhook.
    • CORRUPT_PACKETS_EXCEEDED: Triggers when corrupt-packets exceeds max_corrupt_threshold, dispatching a warning alert alerting engineers to network MTU or packet anomaly issues.
    • SERVER_UNREACHABLE_OR_AUTH_FAILED: Triggers on HTTP errors (e.g. 401 unauthorized or 500 internal error), notifying teams of authentication or webserver failure.
    • HEALTHY: Confirms nominal response metrics, logging status via io.kestra.plugin.core.log.Log.
  5. log_audit_complete always records execution completion and active zone counts for compliance history.
  6. The global errors block intercepts connection drops or socket timeouts to immediately notify on-call engineers when the PowerDNS container is unreachable.

What you get

  • Early detection of backend database connection pool exhaustion or query latency causing PowerDNS to drop authoritative replies.
  • Proactive alerting on network packet corruption surges that indicate potential DNS amplification or packet inspection truncation.
  • Continuous validation that administrative REST endpoints can authenticate and query authoritative zones.
  • Centralized execution history providing a clear operational audit trail of DNS availability.

Who it's for

  • Network Operations Center (NOC) and Site Reliability Engineers managing authoritative DNS infrastructure.
  • Telecom and Platform Engineers operating PowerDNS Authoritative Servers in Kubernetes or bare-metal environments.
  • Infrastructure teams responsible for DNS service availability across hybrid and multi-cloud networks.

Why orchestrate this with Kestra

Authoritative DNS is mission-critical infrastructure where silent degradation causes widespread cascading service failures. Static port checks only confirm whether the UDP/TCP port is open, missing backend database lockouts that result in SERVFAIL responses. Kestra provides declarative scheduling, robust error handling, secret masking, and structured Slack integration without custom sidecar scripts.

Prerequisites

  • A running PowerDNS Authoritative Server (version 4.8+), with its built-in webserver and API enabled in pdns.conf (webserver=yes, api=yes, api-key=...). PowerDNS publishes an official open-source Docker image (powerdns/pdns-auth-48:latest) requiring no commercial license or account.
  • A Slack incoming webhook URL configured for operational alerts.

Secrets

  • POWERDNS_API_KEY: API key configured in pdns.conf via the api-key directive, used to authenticate against the /api/v1 REST endpoints.
  • SLACK_WEBHOOK_URL: Slack incoming webhook URL used by alert_servfail_spike, alert_corrupt_packets, alert_api_failure, and the global errors block.

Quick start

  1. Start a local PowerDNS container with webserver API enabled:
    docker run -d --name pdns-test -p 8081:8081 -p 53:53/udp -e PDNS_api=yes -e PDNS_api_key=secret-kestra-key -e PDNS_webserver=yes -e PDNS_webserver_address=0.0.0.0 -e PDNS_webserver_allow_from=0.0.0.0/0 powerdns/pdns-auth-48:latest
    
  2. Configure the POWERDNS_API_KEY and SLACK_WEBHOOK_URL secrets in your Kestra namespace.
  3. Import this blueprint into Kestra and trigger an execution with default inputs.
  4. Confirm that log_healthy_state logs nominal servfail metrics (servfail-answers: 0).
  5. Test alert routing by setting max_servfail_threshold: 0 to observe alert_servfail_spike dispatching to Slack.
  6. Enable periodic_dns_audit once verified.

How to extend

  • Add zone serial parity validation using io.kestra.plugin.core.flow.EachSequential to check primary and replica zone serial numbers for replication drift.
  • Wire a downstream PagerDuty escalation via io.kestra.plugin.pagerduty.notifications.PagerDutyAlert when SERVFAIL_SPIKE_DETECTED fires in production environments.
  • Export DNS latency metrics to Prometheus using io.kestra.plugin.prometheus.PushGateway for long-term capacity trending.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.