SecDNS

Set up SecDNS on a UniFi Dream Machine with custom DNS

Route every device on your UniFi network through encrypted SecDNS by setting per-network custom DNS plus a port-53 redirect, in under fifteen minutes.

Set up SecDNS on a UniFi Dream Machine

The UniFi Dream Machine (UDM, UDM Pro and UDM SE) does not ship with a native DoH or DoT client, but you can still force every device on the LAN through SecDNS by setting custom DHCP DNS and intercepting port 53. The whole setup takes about fifteen minutes.

What you will need

  • A SecDNS account
  • A UniFi Dream Machine running UniFi Network 8.0 or newer
  • Admin access to the UniFi web UI
  • The SecDNS anycast resolver IP and the DoH URL https://dns.secdns.io/dns-query/<device-id>

Setup steps

  1. Create a device in SecDNS. Sign in, open Devices and add a new UniFi device. Copy the anycast IP shown on the device detail page. [screenshot placeholder]
  2. Open Network settings. Sign in to UniFi Network. Go to Settings, Networks and pick the LAN you want to protect. [screenshot placeholder]
  3. Set DNS Server entries. Expand DHCP Service Management. In DHCP Name Server switch the toggle to Manual and enter the SecDNS anycast IP as the primary DNS server. Leave the secondary blank to avoid leaking.
  4. Apply and renew clients. Click Apply Changes. Existing clients keep the old DNS until their lease renews. From a test client run ipconfig /renew (Windows) or sudo dhclient -r && sudo dhclient (Linux).
  5. Add a port 53 redirect (optional). Settings, Routing, Port Forwarding lets you redirect outbound UDP/TCP 53 from the LAN back to the UDM. This blocks devices that hardcode public DNS (some smart TVs and IoT devices).
  6. Test from a client. Visit https://dnscheck.tools or run dig +short whoami.cloudflare TXT. The resolver hostname should report SecDNS infrastructure.

Verify it works

On a Mac or PC run ipconfig /all (Windows) or scutil --dns (macOS) and confirm the DNS server matches the SecDNS anycast IP. From https://dnscheck.tools the upstream resolver should be SecDNS. The SecDNS dashboard Live Logs panel fills within seconds.

Troubleshooting

  • Clients still use Google or Cloudflare DNS. Some devices (Chromecast, Echo, smart TVs) hardcode 8.8.8.8 or 1.1.1.1. Enable the optional port 53 redirect rule above.
  • No internet after the change. Confirm the SecDNS IP is reachable from the UDM by running ping from the SSH console. If port 53 is filtered upstream, switch to the alternate anycast IP listed on the device detail page.
  • UniFi Talk drops calls. Verify SecDNS is not blocking ui.com or unifi.ui.com. Both are required for Talk and Protect.
  • IPv6 leaks. Pure DHCP DNS only sets IPv4. Also configure RDNSS in Settings, Networks, IPv6 so clients get the SecDNS IPv6 anycast address.

Notes

UDM Pro users can install AdGuard Home or unbound through UniFi OS containers (UDM-Pro 3.0+ supports unifi-os shell). That lets you do DoT or DoH upstream to SecDNS rather than plain UDP/53.

Frequently asked questions

Does UniFi support DoH or DoT natively?

The UniFi Dream Machine does not yet support DoH or DoT upstreams in the stock UI. Use plain UDP/53 to the SecDNS anycast IP, or add an Adblock Plus or AdGuard Home container on the UDM Pro for native DoT forwarding.

Will this break UniFi Talk or Protect?

No. Talk and Protect connect to Ubiquiti cloud endpoints by hostname, which resolve correctly through SecDNS. Just make sure you do not block ui.com in your SecDNS policy.

Can I configure per-VLAN profiles?

Yes. Create one SecDNS device per network in the UniFi UI. Each VLAN gets its own SecDNS resolver IP so query logs and policies stay separated.

What about IPv6?

Add the SecDNS IPv6 anycast address in DHCPv6 Name Server. If your ISP delegates a prefix, also enable Router Advertisement RDNSS pointing at the same IPv6 endpoint.

How do I roll back?

Set DHCP Name Server back to Auto. Apply the change and reboot affected clients so they pick up DHCP DNS from the UDM again.