Honor the user-defined UpstreamMode for the internal DNS proxy #4403
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.
Hi there!
First, I'd like to thank the team for the amazing software! 🎉
I've been using AdGuardHome for over a year and it has never failed me 😃
This pull request addresses an issue I've noticed that happens whenever the first upstream resolver is down (admittedly I think it might only happen when using DNSCrypt): The blocklists won't update.
Normally, the old blocklists would be used again in such a case, but if there are no old lists then nothing is used.
Why isn't the next resolver retrieved? Well, I'm not sure, it does seem to happen with plain DNS resolvers, but it appears it doesn't with DNSCrypt (haven't tried other protocols though).
Maybe this 5 min delay to wait for the resolver's response is guilty (plain DNS don't wait 5 min, but DNSCrypt apparently does):
https://github.com/AdguardTeam/AdGuardHome/blob/master/internal/home/home.go#L852
Anyways, if the internal DNS proxy is also able to work in the same mode than the external one (by honoring the user-defined UpstreamMode) the issue is gone when using parallel mode, thus this is what this PR is about.
That said, I'm not sure it this should become a hard-coded behavior as updating the blocklists should be a priority, especially if there are no old ones 🤔
Let me know what you think 😊