Skip to content

Commit 684b320

Browse files
committed
docs: clarify domain set refresh timing
1 parent 439935c commit 684b320

2 files changed

Lines changed: 38 additions & 1 deletion

File tree

dns_dhcp.rst

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,33 @@ To increase the limit from the CLI, run the following commands: ::
220220
This option is not exposed in the UI, but the change will persist across updates and will not be overridden by the UI.
221221

222222

223+
.. _dns_dhcp_domain_set_refresh-section:
224+
225+
Domain set refresh timing
226+
-------------------------
227+
228+
:ref:`Domain set <domain_sets-section>` entries are refreshed when dnsmasq performs a new lookup for the domain.
229+
When responses are served from the local cache instead of performing a new lookup, the IP addresses are not re-added to the set.
230+
This can cause intermittent gaps if the ipset expires before the DNS TTL expires, or if the cache prevents dnsmasq from performing fresh lookups.
231+
Note that Adblock may alter dnsmasq behavior and affect domain set refreshing.
232+
233+
A cron job runs every 10 minutes to refresh all domain sets, but it also depends on dnsmasq performing actual lookups rather than serving cached results.
234+
235+
To resolve domain set refresh issues, adjust the DNS cache TTL settings:
236+
237+
.. code-block:: text
238+
239+
uci set dhcp.@dnsmasq[0].max_cache_ttl=300
240+
uci set dhcp.@dnsmasq[0].max_ttl=300
241+
uci commit dhcp
242+
reload_config
243+
244+
These settings ensure that cached entries expire promptly, allowing dnsmasq to perform fresh lookups and properly update domain sets.
245+
Please note that setting will override the default TTL provided by upstream DNS servers.
246+
Such a low TTL may increase the number of queries sent to upstream DNS servers, which can lead to increased network traffic and potential
247+
performance issues if the upstream servers have rate limits or if there are many clients making frequent DNS requests.
248+
Use this configuration with caution and monitor the system's performance after applying it.
249+
223250
DNS Rebind Protection
224251
---------------------
225252

@@ -363,4 +390,3 @@ External references
363390

364391
- `OpenWrt DNS and DHCP documentation <https://openwrt.org/docs/guide-user/base-system/dhcp>`_
365392
- `Dnsmasq manual <https://thekelleys.org.uk/dnsmasq/docs/dnsmasq-man.html>`_
366-

objects.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ Add an Host Set
192192
- Once you're satisfied with your host set configuration, click :guilabel:`Add host set` to create it
193193
- If you need to start over or cancel the process, click :guilabel:`Cancel`
194194

195+
.. _domain_sets-section:
196+
195197
Domain Sets
196198
===========
197199

@@ -246,6 +248,15 @@ When to use domain sets:
246248
- for creating security policies based on domain reputation
247249

248250

251+
DNS cache timing
252+
----------------
253+
254+
Domain set entries are refreshed when dnsmasq performs a new lookup for the domain.
255+
If the answer is served from the local cache, the IP is not added back to the set.
256+
257+
See :ref:`dns_dhcp_domain_set_refresh-section` for how cache timing affects domain set refreshes.
258+
259+
249260
Manage Domain Sets
250261
------------------
251262

0 commit comments

Comments
 (0)