On a home network, clients often send readable DNS questions over UDP or TCP port 53. A local dnsdist proxy can accept them and forward them to a chosen resolver over DNS over HTTPS (DoH). Plan around where that encryption begins: the proxy-to-upstream leg is protected, while the client-to-proxy leg remains plain DNS and a browser choosing its own resolver needs separate attention.
This walkthrough uses dnsdist on an always-on Linux host. Clients that accept your DHCP DNS setting use the proxy as an ordinary DNS server; the proxy uses outgoing DoH. We will verify both a working DNS answer and the route taken to get it. I would rather see two boring packet captures than declare victory because a web page loads.
What the proxy changes
dnsdist is a DNS proxy and load balancer, not a recursive resolver itself. It needs a downstream server. PowerDNS documents outgoing DoH support beginning with dnsdist 1.7.0; the installed binary also needs that feature compiled in. With a DoH backend, dnsdist can receive ordinary UDP or TCP DNS on the LAN and forward the questions to an HTTPS endpoint. The upstream resolver sees the queries, so choose one whose operation and privacy policy you are comfortable with.
Encryption protects the question between the proxy and the selected upstream, while leaving the upstream IP address, timing and traffic volume observable. Other application traffic may also reveal destinations. Decide whether that boundary meets your home DNS goal before treating the setup as a privacy solution; it does not provide anonymity.
Protecting the client-to-proxy hop would require a supported encrypted frontend and clients configured to use it, with the associated certificate and client-management work. This example keeps that hop as ordinary LAN DNS. Applications that choose their own resolver need another check: Firefox, for example, documents that its DoH setting can bypass the local resolver. The DoH enforcement guide covers that separate policy problem.
Plan the host and resolver
Give the always-on Linux host a stable LAN address, such as 192.168.1.2, and check its interfaces, default route and firewall. For clients on other VLANs, allow the path to both UDP and TCP port 53. Bind the listener to the intended LAN address and limit the permitted client networks so the DNS service remains within the home network.
Choose one documented DoH endpoint. The example below uses Cloudflare's 1.1.1.1:443 with TLS name cloudflare-dns.com and path /dns-query. Address, TLS certificate name and URL path are separate dnsdist settings; a URL alone is not a drop-in newServer() replacement. You can substitute another provider after checking its current endpoint, address, certificate name and policy. Do not silently mix one provider's IP with another provider's TLS name.
Before installation, check what already owns port 53 on the host:
sudo ss -lntup '( sport = :53 )'
If another DNS service listens on your intended LAN address, decide which service should own that address. Adjust only that binding or use a dedicated address. Stopping the host's local resolver wholesale can break package updates and name resolution while you are trying to install a replacement. Record your current DHCP DNS value as the rollback path before changing it.
Install a build with outgoing DoH
Follow the PowerDNS installation guide[1] for a supported package source matching your distribution and architecture. Check repository and signing-key instructions for that OS release before installing, since old Bookworm instructions may not fit another host. Then inspect the installed binary:
dnsdist --version
Look for outgoing-dns-over-https(nghttp2) in the reported features, as the dnsdist DoH guide[2] instructs. A version number without that feature is insufficient. If the feature is absent, stop here and use a package that includes it; the config below cannot force support into the binary.
The example is a Lua configuration. dnsdist 2.1 uses YAML as its default configuration format, while Lua remains supported. Confirm the configuration file and format used by your installed package and its systemd unit. Back up that file before replacing it. On a host using /etc/dnsdist/dnsdist.conf for Lua:
sudo cp /etc/dnsdist/dnsdist.conf /etc/dnsdist/dnsdist.conf.bak
If that file does not exist, find the package's active config path instead of creating an unused file and wondering why the daemon ignored it.
Configure one outgoing DoH backend
Use this Lua configuration as the starting point; replace the listener and ACL subnet with your own network. setACL() makes the allowed range explicit. newServer() supplies the backend address, TLS provider, name to verify, DoH path and certificate validation. The backend is placed in a named pool, and the rule sends incoming questions to that pool.
-- LAN-facing, ordinary DNS. Change these to your network.
addLocal("192.168.1.2:53")
setACL({"192.168.1.0/24"})
-- dnsdist 1.7+ with outgoing DoH compiled in.
newServer({
address="1.1.1.1:443",
tls="openssl",
subjectName="cloudflare-dns.com",
dohPath="/dns-query",
validateCertificates=true,
pool="doh"
})
addAction(AllRule(), PoolAction("doh"))
Binding to a specific address is clearer than 0.0.0.0:53, which would also listen on interfaces you might not intend. Add any other local subnet deliberately to the ACL, and enforce the same scope with the host firewall. If the host needs to query itself through the proxy, add its actual source address or loopback to the ACL and test that path; do not assume the LAN subnet covers loopback.
The upstream address is an IP so the proxy does not need a working DNS lookup to find its DoH server at startup. The TLS name still matters: certificate validation must match the provider. Keep the host's clock and CA certificates current. Opening outbound TCP 443 to the selected address is necessary; opening the inbound LAN DNS port to the world is not.
Check the config before starting the service. Point -C to the actual Lua file if your installation uses a different path:
sudo dnsdist --check-config -C /etc/dnsdist/dnsdist.conf
sudo systemctl restart dnsdist
sudo systemctl status dnsdist
After --check-config checks syntax and configuration, confirm the service actually uses that file and can establish the upstream TLS session. On failure, read journalctl -u dnsdist -n 100 --no-pager before changing DHCP. If the package starts from YAML, either express the setup in its active YAML file or explicitly tell the service to use the Lua file. Passing a check on an unused configuration would leave the deployment unchanged.
Verify the DNS and the transport
From another machine on the allowed LAN subnet, query the proxy directly:
dig -r @192.168.1.2 example.com A
dig -r +tcp @192.168.1.2 example.com A
Both should return a usable DNS response. Do not require an AD flag as your success criterion: that concerns DNSSEC validation and response flags, while this test is about the proxy and its upstream transport. Repeat with a name in a domain you control if you need an uncached, distinguishable query. Avoid treating a canned NXDOMAIN response as proof of encryption either.
Capture the proxy host’s upstream traffic while repeating the direct queries. Replace eth0 with the real interface. Start the capture before a new upstream connection is established; during this pre-DHCP test, you can start it and then restart dnsdist from another terminal so the TLS handshake is included:
sudo tcpdump -ni eth0 -s 0 -w dnsdist-upstream.pcap 'host 1.1.1.1 and (tcp port 443 or port 53)'
After issuing the queries, stop tcpdump with Ctrl+C and open dnsdist-upstream.pcap in Wireshark. Inspect the connection to the configured resolver for TLS negotiation and subsequent encrypted records; the tls display filter helps find them. Traffic using port 443 alone does not establish encryption. Read the capture alongside the active configuration’s DoH path and certificate-validation settings and the successful DNS responses. Without decryption secrets, the capture does not show the DNS payload inside TLS.
The capture filter only covers traffic to or from 1.1.1.1. Use a separate capture covering port 53 to look for plain DNS to other destinations, and distinguish the expected client-to-proxy LAN queries from the host’s outbound requests. Other services and dnsdist’s health checks can generate traffic too, so correlate the controlled query with the flow rather than assigning every packet to it. The ordinary service journal is useful for errors; do not assume it contains a per-query log.
If the query fails, work from the inside out. Check that dnsdist listens on the chosen IP, that the client subnet passes the ACL and firewall, that the host can reach the upstream on TCP 443, and that the certificate name and CA validation succeed. A service that answers from some other local resolver is not a successful dnsdist test. Once the direct query works, use the router's DHCP settings to announce 192.168.1.2 as DNS and renew a test client's lease. Check that client's active DNS server, then repeat the query without @192.168.1.2.
Scope, failover and ongoing care
DHCP changes reach clients that honor them. Some devices use static DNS, browsers choose their own DoH, and an IPv6 router advertisement or DHCPv6 setting can advertise a different resolver. Check the actual client configuration and both IP families. Redirecting outbound port 53 at the router can catch some ordinary DNS clients, but does not catch DoH over HTTPS and can loop if the proxy itself is redirected. Treat that as a separate firewall change with its own tests.
Plan the failure path before making this proxy the clients’ DNS server. If it stops, dependent clients lose name resolution. A tested second encrypted proxy can provide resilience, or you can document a rollback to the previous router setting. An unrelated plain-DNS secondary gives clients another resolver path outside the encrypted proxy, so it does not belong in this configuration.
dnsdist does not cache answers unless you configure a packet cache. The PowerDNS caching guide[3] documents newPacketCache() and attaching it to a pool; add it only if you need it and understand its memory and staleness behavior. Measure latency with the names and concurrency your clients actually use before deciding whether the cache helps. Keep the active config, selected endpoint, ACLs and rollback setting backed up. Before an upgrade, read the upgrade guide[4], validate the config, and perform the same direct query and transport capture again.
Before making the proxy the household default, keep the successful UDP and TCP responses and the matching TLS capture with the configuration backup. Confirm that the test client uses the announced DNS server after its lease changes, then check applications with their own resolver settings separately. Repeat those checks after a package, endpoint or network change; a working answer is useful evidence only when you also know which path produced it.