Repository navigation
Conversation
When a server answered NXDOMAIN, REFUSED or NOTAUTH, the next entry of the sequence is tried and the response is kept in case nothing better comes. But if that next entry failed with a network error, the error was returned and the query was dropped instead.
Member
|
Thanks for the PR. But I prefer to keep the current intentional behavior. After a negative response, the next entries are there to confirm or to correct it. This is what makes split-horizon rules work. If a fallback doesn't respond, we don't know if the name exists: returning NXDOMAIN could then be wrong, and clients cache it. |
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.
With a forwarding rule such as
lan 192.168.1.1,$BOOTSTRAP, a name that does not exist on 192.168.1.1 gets no answer at all when the bootstrap resolvers cannot be reached: the client times out instead of receiving the NXDOMAIN returned by the first server. The same happens with$DHCPor$RESOLVCONFservers that are down, and with REFUSED and NOTAUTH responses.After one of these responses, the plugin stores it and tries the next entry of the sequence, so that the last response is returned if nothing better comes (a143fb0): plugin_forward.go#L442-L450. But when the next exchange fails,
erris set and the loop ends withreturn err, and a plugin error makes ApplyQueryPlugins drop the query. The stored response is now returned in that case. The error is still returned when no server answered.Tested with a new unit test (a local UDP server answering NXDOMAIN, followed by
$BOOTSTRAPpointing to a closed port: fails before withconnection refused;go testandgo vetpass after), and with the built proxy in offline mode and the ruletest 127.0.0.1:5301,$BOOTSTRAP: a missing name gets no response before (the client times out) and NXDOMAIN after; names that exist are answered in both cases.