Disable negative caching for local.hass.io - #202
Merged
Conversation
When a name under local.hass.io is queried before Supervisor's hosts file entry is picked up (e.g. right after an add-on started), the resulting NXDOMAIN is negative-cached for ~5s, prolonging resolution failures even after the hosts entry became visible. Disable caching of denial responses for local.hass.io. Positive answers are still cached, and entries for these names live in the local hosts file anyway, so negative caching provides no benefit here. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
This PR adjusts the CoreDNS configuration used by the DNS plugin to prevent negative caching (NXDOMAIN/NODATA) for names under local.hass.io, reducing “stale NXDOMAIN” amplification during the short window before newly-written /config/hosts entries are reloaded.
Changes:
- Replace the bare
cachedirective with acache { ... }block. - Disable denial (negative) caching specifically for
local.hass.iowhile keeping positive caching enabled.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The static /etc/corefile is used when tempio fails to render the template; keep its cache block in sync. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sairon
approved these changes
Aug 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed change
Add
disable denial local.hass.ioto thecacheplugin on the main server block.When a name under
local.hass.iois queried before Supervisor's freshly written hosts entry has been picked up (e.g. right after an add-on started), the resulting NXDOMAIN is negative-cached for ~5s — so resolution keeps failing even after the hosts file reload has made the entry visible.These names are answered from the local hosts file (or the
templatefallback), so negative caching provides no upstream offload; disabling it only removes the failure amplification. Positive answers are still cached.Companion PR: #201 (faster hosts file reload), which shrinks the window in which the stale NXDOMAIN can be produced in the first place.
Type of change
🤖 Generated with Claude Code