DNS over TLS

Started by mika, October 17, 2026, 09:56:10 PM

Previous topic - Next topic
Hello there,

actually till now I didn't pay much attention to the security of DNS, as FF is securing it through HTTPS already. But I wanted to configure Opnsense, so that it would work as a Resolver but also look up at specific DNS over TLS for unknown addresses, but it kinda still goes over Port 53 and is not using the specified DNS's. I don't know why, as I also disabled the DNS server options.

October 17, 2026, 10:21:56 PM #1 Last Edit: October 17, 2026, 10:24:57 PM by meyergru
Your question is waaaay too unspecific. It still goes over port 53 - "it" meaning what, exactly?

What type of DNS service do your clients use? Unbound, DNSmasq, OpenDNS, Bind or something else? How do you know that they do not use something else despite you sending them OpnSense's IP via DHCP, like 8.8.8.8?

Aside from your clients, does your OpnSense itself use upstream or configured servers?

You know, DNS is not as easy as it used to be these days.
Intel N100, 4* I226-V, 2* 82559, 16 GByte, 500 GByte NVME, Leox LXT-010H-D

1100 down / 450 up, Bufferbloat A+

Quote from: mika on October 17, 2026, 09:56:10 PMI also disabled the DNS server options.

In addition to what @meyergru said, I also suggest to be a bit more specific about the statement above, that is where did you change what exactly?

October 18, 2026, 07:49:42 AM #3 Last Edit: October 18, 2026, 09:28:19 AM by (MARLOO)
Quote from: mika on October 17, 2026, 09:56:10 PMHello there,

actually till now I didn't pay much attention to the security of DNS, as FF is securing it through HTTPS already. But I wanted to configure Opnsense, so that it would work as a Resolver but also look up at specific DNS over TLS for unknown addresses, but it kinda still goes over Port 53 and is not using the specified DNS's. I don't know why, as I also disabled the DNS server options.


Here's the official OPNsense documentation for Unbound DNS:

https://docs.opnsense.org/manual/unbound.html

Add your DoT servers under Services → Unbound DNS → DNS over TLS. For a catch-all entry, leave the Domain field empty and use port 853.

Do not enable Forwarding Mode if you want Unbound to use only those DoT servers: it can make Unbound use the system DNS servers on port 53 instead.

Also disable Use System Nameservers, leave the DNS servers under System → Settings → General empty, and disable "Allow DNS server list to be overridden by DHCP/PPP on WAN".

Traffic on port 53 between clients and OPNsense is normal, since Unbound listens there. Use Packet Capture to check whether port 53 traffic is going from OPNsense or a client directly to an external DNS server.
Hardware: N5105 Intel Celeron  
                       OPNsense | Home Lab | Linux & Home Automation
                               "Secure the network, automate the rest."

Also, a  DNAT rule may help redirect your clients to your DNS server if they ever try to reach an external service.
[HW]
Protectli VP2420
16GB RAM
240 GB SSD

[Versions]
OPNsense 26.7.7-amd64
FreeBSD 15.1-RELEASE-p4
OpenSSL 3.5.9

[Feature set]
Unbound DNS
Kea DHCPv4
Suricata IPS (Divert mode)
Wireguard Client VPN
HAProxy

October 18, 2026, 09:29:54 AM #5 Last Edit: October 18, 2026, 09:35:38 AM by (MARLOO)
Quote from: turipriv on October 18, 2026, 09:19:13 AMAlso, a  DNAT rule may help redirect your clients to your DNS server if they ever try to reach an external service.


Yes, a LAN DNAT/port-forward rule redirecting outbound TCP/UDP port 53 to 127.0.0.1:53 is a good addition. It prevents clients from bypassing Unbound by querying external DNS servers directly.

Note that it will not catch clients using DNS-over-HTTPS or DNS-over-TLS directly, such as browsers with secure DNS enabled.
Hardware: N5105 Intel Celeron  
                       OPNsense | Home Lab | Linux & Home Automation
                               "Secure the network, automate the rest."

Quote from: (MARLOO) on October 18, 2026, 09:29:54 AMNote that it will not catch clients using DNS-over-HTTPS or DNS-over-TLS directly, such as browsers with secure DNS enabled.
Just had my first victim of blocking DoT via Port 853 UDP/TCP the other day : I was very proud of my OPNsense that day! ^_^
Weird guy who likes everything Linux and *BSD on PC/Laptop/Tablet/Mobile and funny little ARM based boards :)

October 18, 2026, 11:13:07 PM #7 Last Edit: October 18, 2026, 11:55:52 PM by (MARLOO)
Quote from: nero355 on October 18, 2026, 05:53:50 PMJust had my first victim of blocking DoT via Port 853 UDP/TCP the other day : I was very proud of my OPNsense that day! ^_^

The pure joy of watching my toy firewall reject a packet on 853. Truly the highlight of my day.
Hardware: N5105 Intel Celeron  
                       OPNsense | Home Lab | Linux & Home Automation
                               "Secure the network, automate the rest."