core: dnsmasq: strict-order functionality not working as expected

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

dnsmasq in 25.1.1/2 has a ‘possible’ bug that the dnsmasq strict-order functionality does not work as expected.

OPNsense respects the strict-order and forwards the dns request to the 1st listed server (rather than all in parallel); however, if the 1st server does not respond, dnsmasq does not forward the request to the next server; and instead waits for a long time and then the query times out.

To Reproduce

Steps to reproduce the behavior:

  • I have BlockyDNS running on port 53035.
  • I have a custom dnsmasq configuration file (0-custom.conf) with the following entries. The servers list on the GUI page are blank
server=192.168.1.1#53035
server=1.1.1.1
add-mac
add-subnet=32,128

If I enable the strict-order option in the GUI, my requests are only forwarded to 192.168.1.1:53035 and all works as expected.

However, if I disable my ‘Blocky DNS Instance’ running on port 53035, then the query just times out after a long time, rather than being forwarded to 1.1.1.1 as expected.

Expected behavior

dnsmasq to forward the query to the next listed dnsserver (1.1.1.1) rather than timing out.

Additional context

In addition, since a lot of changes are going into dnsmasq; may I request that these features be added to the dnsmasq GUI

  • GUI option to specify a port number along with the dns server address (default 53 if unspecified)
  • GUI options for add-mac
  • GUI options for add-subnet

Environment OPNsense 25.1.2

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 17 (11 by maintainers)

Most upvoted comments

Cant you try this test yourself now? I think I have tested enough and I gave more hints what to potentially try.

It could be true that all DNS Servers must be exactly the same for this to work correctly.

It looks like strict order works as expected for me. I have configured 3 servers:

Sequence 1, Domain: example.com, Server: 192.168.99.99 Sequence 2, Domain: example.com, Server: 192.168.22.22 Sequence 3, Domain: example.com, Server: 8.8.4.4

This is the result of a new query that was not cached:

igc1_vlan7_DSLpppoe0 | 2025-03-1215:27:32.900649 |   |   | length 60: 80.151.100.99.30194 > 192.168.99.99.53: UDP, length 28
igc1_vlan7_DSLpppoe0 | 2025-03-1215:27:37.955230 |   |   | length 60: 80.151.100.99.30194 > 192.168.22.22.53: UDP, length 28
igc1_vlan7_DSLpppoe0 | 2025-03-1215:27:42.989161 |   |   | length 60: 80.151.100.99.30194 > 8.8.4.4.53: UDP, length 28
igc1_vlan7_DSLpppoe0 | 2025-03-1215:27:43.001018 |   |   | length 124: 8.8.4.4.53 > 80.151.100.99.30194: UDP, length 92
igc1_vlan7_DSLpppoe0 | 2025-03-1215:27:43.012388 |   |   | length 60: 80.151.100.99.40259 > 192.168.99.99.53: UDP, length 28

First try: 192.168.99.99.53 -> Timeout after 5s Second try: 192.168.22.22 -> Timeout after 5s Third try: 8.8.4.4 -> Woo response, my client got an answer (These all happened during one single nslookup, did not have to reinitiate it.)

I merely pointing you to the documentation, if the upstream documentation is wrong, my comment obviously is so too.