Add resolver fallback to the null resolver (getaddrinfo)#103
Open
delthas wants to merge 1 commit intonigoroll:masterfrom
Open
Add resolver fallback to the null resolver (getaddrinfo)#103delthas wants to merge 1 commit intonigoroll:masterfrom
delthas wants to merge 1 commit intonigoroll:masterfrom
Conversation
This enables a best-effort, two-step resolution when a resolver is
configured:
- if the DNS resolver returns any domain, that record is used with its
corresponding TTL
- otherwise, the module tries resolving the name with the default, NULL
resolver, which is just a wrapper over getaddrinfo
* if the resolution succeeds, this was likely a domain in /etc/hosts
or an IP literal, which was not known by the DNS server. The
associated record has no TTL value and uses the default director
TTL.
* if the resolution fails, this was likely a bad domain. No records
are stored and a new request is made after the default director TTL,
as was done previously.
fd8a233 to
a84e31f
Compare
Owner
|
Thank you for your work on this! Regarding the implementation, I would actually like to see if we can avoid the additional while block. As you already said you'd be fine with amending, I would just do that. But, more importantly:
|
Owner
|
Hi @delthas, are you still interested in this patch? If yes, I would be interested in your opinion about my two questions:
|
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.
This enables a best-effort, two-step resolution when a resolver is configured:
The patch is somewhat dumb, it just wraps the resolve logic in a loop that can iterate twice. The goal was to minimize the size of
git diff -w.This causes the module to log Lookup & Results & Error twice in case we do the fallback attempt, which could be a nice side-effect (we can investigate a DNS error in varnishlog but see that it still succeeded). I don't have a strong opinion about this one.
Feel free to amend and merge if you'd like. Otherwise I can make changes. 😄