SecDNS

Set up SecDNS on OPNsense with Unbound DoT forwarding

Forward every Unbound query on your OPNsense firewall to encrypted SecDNS DoT in about fifteen minutes, with per-tenant filtering and audit logs.

Set up SecDNS on OPNsense

OPNsense ships with Unbound, which supports DoT upstreams natively. Forwarding to SecDNS protects every client behind the firewall with a single configuration change.

What you will need

  • A SecDNS account
  • An OPNsense 23.7 or newer install with Unbound enabled
  • Admin access to the web UI
  • The SecDNS anycast resolver IP and the hostname dns.secdns.io

Setup steps

  1. Create a device in SecDNS. Sign in, open Devices and add a new OPNsense device. Copy the anycast resolver IP and the DoT hostname. [screenshot placeholder]
  2. Open Unbound general settings. In the OPNsense web UI go to Services, Unbound DNS, General. Confirm Unbound is enabled and listening on the LAN interface. [screenshot placeholder]
  3. Enable DNSSEC and forwarding mode. Tick DNSSEC and Query Forwarding so Unbound stops doing local recursion. Apply changes.
  4. Open DNS over TLS. Go to Services, Unbound DNS, DNS over TLS (or Query Forwarding, depending on the OPNsense version). Add a new server, paste the SecDNS anycast IP, set the port to 853 and the verify hostname to dns.secdns.io.
  5. Disable upstream resolvers in System DNS. Open System, Settings, General. Remove every DNS server other than 127.0.0.1. Untick Allow DNS server list to be overridden by DHCP so the WAN cannot inject ISP DNS.
  6. Apply and test. Apply Unbound changes. From any LAN client run dig +short whoami.cloudflare TXT @<opnsense-lan-ip> to confirm responses originate from SecDNS.

Verify it works

On OPNsense run drill -k <key> @127.0.0.1 dnssec-name-and-shame.com to confirm DNSSEC works. From a LAN client visit https://dnscheck.tools and confirm the upstream is SecDNS. On the SecDNS dashboard the device Live Logs panel should start filling within seconds.

Troubleshooting

  • Unbound fails to start after the change. Check System, Log Files, Resolver for a TLS handshake error. Verify you typed dns.secdns.io exactly, including the trailing TLD, in the verify hostname field.
  • Latency spikes on first queries. Increase Unbound's outgoing TCP buffers (Services, Unbound DNS, Miscellaneous) and confirm Use Outgoing Interfaces is set to WAN.
  • Some clients still use ISP DNS. Block outbound port 53 and 853 from the LAN to anything other than the firewall, so devices cannot bypass Unbound.
  • DNSSEC validation fails on bogus domains. This is the desired behaviour. Configure SecDNS to allow specific domains rather than disabling DNSSEC.

Notes

If you run HA with CARP, configure DoT on both nodes and synchronise the Unbound config via XMLRPC so failover preserves SecDNS forwarding.

Frequently asked questions

Does OPNsense support DoH as well as DoT?

Unbound on OPNsense only supports DoT natively. For DoH, install the dnscrypt-proxy plugin from System, Firmware, Plugins, then point Unbound at 127.0.0.1 on the dnscrypt-proxy port.

Will this break my local DNS overrides?

No. Unbound continues to answer locally for host overrides, aliases and the LAN domain. Only queries that miss the local cache are forwarded over DoT.

Do I still need to enable DNS Block lists in OPNsense?

Most OPNsense users delegate blocking entirely to SecDNS. The local Block lists feature still works if you want a belt-and-braces approach but adds maintenance overhead.

How do I keep DHCP clients on the firewall?

Leave the OPNsense DHCP server unchanged. It hands out the LAN IP as the DNS server; Unbound forwards from there. Clients never talk to SecDNS directly so per-device filtering happens at the firewall.

Can I split queries per VLAN?

Yes. Create one SecDNS device per VLAN and configure separate Unbound forward zones with different DoT upstreams. Each VLAN then gets its own audit log and filtering profile.