A secure, high-performance bridge between PowerDNS dnsdist 2.x and Home Assistant 2025.10+. Monitor every proxy, surface aggregated insights, and control dnsdist safely through REST-only actions.
| Integration type | Hub (per-host and per-group devices) |
| Domain | dnsdist |
| Current version | 1.4.2 |
| Home Assistant | 2025.10+ |
| dnsdist | 2.x |
| License | BSD 2-Clause |
- Features
- Installation
- Configuration
- Entities
- Lovelace Card
- Options
- Services
- Troubleshooting
- File Map
- Changelog
- Support
- License
- UI-only setup with zero YAML required
- Multiple hosts, each dnsdist endpoint becomes its own device
- Aggregated groups with smart rollups (sum counters, average CPU, max uptime, priority security status)
- Backend monitoring with per-backend health (binary sensor), query counters, and enable/disable switches
- Filtering rule sensors for per-rule match counts with idle/active icons
- Dynamic rule sensors for temporary blocks (dynblocks) from rate limiting and DoS protection
- Custom Lovelace card with gauges, counters, filtering rules, and dynamic rules
- Long-term statistics ready sensors (
TOTAL_INCREASINGcounters,MEASUREMENTpercentages) - Rolling request rates (
req_per_hour,req_per_day) with history persistence across restarts - Secure by default with HTTPS and SSL verification
- Diagnostics bundle with automatic secret redaction
- REST-only services:
clear_cache,enable_server,disable_server,get_backends - Reconfigurable connection parameters (host, port, API key, SSL) without removing the entry
Requires Home Assistant 2025.10 or newer.
- Copy
custom_components/dnsdist/into your Home Assistantconfig/custom_components/directory - Restart Home Assistant
- Go to Settings > Devices & Services > + Add Integration and pick PowerDNS dnsdist
HACS: Add this repository as a custom source or install directly if public.
| Field | Description |
|---|---|
| Name | Display name for Home Assistant |
| Host / Port | dnsdist API endpoint (default port 8083) |
| API Key | Optional |
| Use HTTPS / Verify SSL | Toggle TLS and certificate validation |
| Update interval | Polling frequency in seconds (default 30) |
| Include filtering rule sensors | Disabled by default |
Host validation enforces RFC 1123 hostnames plus IPv4/IPv6 literals. Setup requires a valid dnsdist statistics JSON payload before finishing, so wrong URLs or non-dnsdist endpoints fail fast.
| Field | Description |
|---|---|
| Group name | Home Assistant device label |
| Members | Choose from existing host names |
| Update interval | Default 30 seconds |
| Include filtering rule sensors | Enabled by default |
Group rollups: sum (counters), avg (CPU %), max (uptime), and priority security status (critical > warning > ok > unknown).
Each host or group creates a Home Assistant device with these sensors:
| Sensor | Unit | State class |
|---|---|---|
queries, responses, drops, rule_drop, downstream_errors, cache_hits, cache_misses |
count | TOTAL_INCREASING |
cacheHit, cpu |
% | MEASUREMENT |
uptime |
seconds | MEASUREMENT |
req_per_hour, req_per_day |
count | MEASUREMENT |
security_status |
string | - |
Additional dynamic entities (created per backend / per rule):
| Entity | Type | Description |
|---|---|---|
Backend <address> |
binary sensor | Backend health (up/down) |
Backend <address> Queries |
sensor | Per-backend query counter (TOTAL_INCREASING) |
Backend <address> |
switch | Enable/disable backend via REST API |
Filter <rule name> |
sensor | Per-rule match count with idle/active icons |
Dynblock <network> |
sensor | Block count with reason, action, time remaining |
Rate sensors are extrapolated from available history until enough data is collected (1h / 24h), then switch to actual measured values.
The integration includes a custom Lovelace card that is automatically registered on load.
Features: security status badge, CPU and cache hit needle gauges, uptime display, traffic counters grid, request rate tiles, filtering rules list sorted by match count, dynamic rules list, show/hide zero-hit toggle buttons, clear cache button with confirmation, light/dark theme support, compact mode for sidebars.
If needed, go to Settings > Dashboards > Resources and add /dnsdist_static/dnsdist-card.js?v=1.4.2 as a JavaScript Module.
Add the card via the UI card picker (search for "dnsdist") or manually:
type: custom:dnsdist-card
entity_prefix: dns1 # Required: matches your dnsdist device name
title: My DNS Server # Optional: custom card title
show_filters: true # Optional: show filtering rules (default: true)
show_dynamic_rules: true # Optional: show dynamic rules (default: true)
show_actions: true # Optional: show action buttons (default: true)
compact: false # Optional: compact mode for sidebars (default: false)| Option | Type | Default | Description |
|---|---|---|---|
entity_prefix |
string | required | Device name prefix for entity IDs |
title |
string | entity_prefix | Custom card title |
show_filters |
boolean | true |
Show filtering rules section |
show_dynamic_rules |
boolean | true |
Show dynamic rules section |
show_actions |
boolean | true |
Show action buttons |
compact |
boolean | false |
Compact mode for sidebars |
A visual configuration editor is also available through the Lovelace UI.
From the integration options panel:
- Rename a host or group
- Tune the update interval
- Add or remove group members
- Toggle filtering rule sensors (hosts default off, groups default on)
- Optionally delete existing filter sensors when disabling
To change connection parameters (host, port, API key, SSL), use the Reconfigure button on the integration card.
All services live under the dnsdist domain.
Supplying host targets a specific display name; omit it to broadcast to every host (groups excluded).
service: dnsdist.clear_cache
data:
host: "amandil" # optional
pool: "" # optionalservice: dnsdist.enable_server
data:
host: "amandil"
backend: "192.168.1.10:53"service: dnsdist.get_backends
data:
host: "amandil" # optionalEach host and group device also exposes a Clear Cache button. Group presses cascade to all members.
| Symptom | Resolution |
|---|---|
| Request timed out after 10s | The dnsdist host did not respond in time. Check reachability and webserver load. |
| Group shows "No active members yet" | Normal until each member host completes its first refresh. |
| Counters missing from Recorder | Counters use TOTAL_INCREASING with count unit, ensuring long-term statistics work correctly. |
| Reconfigure connection | Use the "Reconfigure" button on the integration card to change host, port, API key, or SSL settings. |
| REST prerequisites | Ensure the dnsdist webserver is enabled, has an API key, and allows your HA network in the ACL. |
Diagnostics: Visit Settings > Devices & Services > PowerDNS dnsdist > ... > Download diagnostics. Secrets are automatically redacted.
custom_components/dnsdist/
__init__.py config_flow.py coordinator.py
manifest.json options_flow.py group_coordinator.py
const.py sensor.py button.py
utils.py services.py diagnostics.py
strings.json services.yaml
translations/
en.json
brand/ icon.png, logo.png (HA 2026.3+)
frontend/
src/ dnsdist-card.ts, dnsdist-card-editor.ts,
styles.ts, types.ts
www/
dnsdist-card.js Built card bundle
- Add backend monitoring: per-backend health binary sensor, query counter sensor, and enable/disable switch
- Refactor coordinator to fetch server config once for both filtering rules and backends (no extra HTTP request)
- Add reconfigure flow to change host, port, API key, and SSL settings without removing the entry
- Fix empty "Fetch error:" log on timeout, now logs a proper message
- Add 10s timeout to service API calls to prevent hanging
- Use consistent 10s timeout in config flow connection validation (was 5s)
- Cap rolling history deque to 24 hours of samples to prevent unbounded memory growth
- Add comprehensive unit tests for coordinator normalization, group aggregation, and service encoding
- Add local
brand/directory withicon.pngandlogo.pngfor HA 2026.3+ custom integration branding - Fix dispatcher signal leak: group coordinators no longer react to reload signals after entry unload
- Fix system diagnostics producing a spurious error entry from the
_services_registeredsentinel - Fix filtering/dynamic rule preservation: rule sensors now retain last known values when the rules endpoint temporarily fails instead of resetting to zero
- Remove dead
async_get_options_flowstandalone function in options flow module
- Replace Lovelace resource polling loop with direct
async_load()guard - Fix swallowed
ConfigEntryNotReadythat prevented HA from retrying setup - Remove dead secret storage API code
- Use identity comparison for
CoreStateenum to match HA core convention
- Fix crash on Home Assistant 2026.2+ where
LovelaceDatano longer has a.modeattribute
- Add separate toggle buttons for filtering rules and dynamic rules with zero matches
- Fix missing ATTR_* constants that caused integration to fail on load
- Add toggle button to show/hide dynamic rules with zero hits
- Extrapolate request rates from available history when less than 1h/24h of data
- Fix expired dynblock sensors not being removed from entity registry
- Fix OptionsFlow compatibility with newer Home Assistant versions
- Fix dynamic rules not being removed from card when they expire
- Fix time remaining countdown not updating in real-time
- Redesign gauge layout for more compact display
- Add dynamic rules (dynblocks) support with sensors and Lovelace card section
- Group aggregation for dynamic rules with source tracking
- Redesign gauge visualization with needle indicator and segmented color gradient arc
- Add custom Lovelace card with gauges, counters, filtering rules, and visual editor
- Auto-register frontend resource on integration load
- Fix SSL verification logic and improve error handling
- Fix schema serialization and config flow validation; add unit tests and CI workflows
- Fix linting errors, add missing imports, remove blocking sleep, standardize timeout style
- Extract shared utilities into
utils.pyandHistoryMixin; centralize constants
- Remove deprecated HACS metadata; run HACS validation with default checks
- Add HACS validation workflow; align manifests with current requirements
- Validate host entries against RFC 1123; verify dnsdist statistics payload during setup
- Streamline rolling-window rate calculations
- Sanitize backend identifiers in REST services
- Preserve query history across restarts for rolling rate sensors
- Preload platforms during startup; compatibility fallback for removed
COUNTunit
- Report counters with
countunit for Recorder statistics
- Per-entry control over filtering rule sensors with auto-delete option
- Interpolate counters at window horizon for accurate rolling totals
- Report actual rolling-window volume instead of extrapolated estimates
- Reuse shared HTTP session for all API calls
- Switch to REST-only services; single Clear Cache button
- Add
req_per_hourandreq_per_daysensors; fix duplicate device name in display
- HA 2025.10 compatibility; stable entity modeling; robust device identifiers
If you find this integration useful, you can support its development:
BSD 2-Clause -- see LICENSE.

