-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make --retries
global to a name and try with other name servers in a given layer
#451
Merged
Conversation
This file contains 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
phillip-stephens
changed the title
WIP - Make
Make Sep 20, 2024
--retries
global to a name and try with other name servers in a given layer--retries
global to a name and try with other name servers in a given layer
… phillip/93-domain-retries
Do not merge, #411 has cropped back up so figuring out a fix. |
irctc.co.in is a good test domain for this. It's nameserver,
|
zakird
approved these changes
Oct 2, 2024
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.
Closes #93
Description
--retries
global to a name lookupretries
from--retries=1
to--retries=3
. Since retries are no longer just for a single nameserver, we need more and found 3 offered a good balance with runtime/errors.--iterative
, if ZDNS cannot reach (either due to timeout or some other error) a nameserver, a random alternative one will be used from the same layer--network-timeout
to let the user specify the connection timeout for a single on-the-wire network callcachedRetryingLookup
andretryingLookup
into justcachedLookup
since we moved the retry logic up a layer.--iteration-timeout
, we have to set this smaller. I figured the user should have control over this, but I found 2 seconds worked well.cyclingLookup
function.cyclingLookup
takes in an array of nameservers and provided there are--retries
available, will attempt to connect/query a new random un-queried nameserver upon failure.Performance Implications
The aspect of this change that could theoretically affect performance for some queries is prior to this change, during
iterateOnAuthorities
, we'd pick the first authority that we could resolve (need to perform an A lookup to get the authority's IP address if it isn't provided inAdditionals
) to proceed with theiterativeLookup
process. In order forcyclingLookup
to be able to cycle through a list of potential nameservers,iterateOnAuthorities
has been changed to collect all authorities sequentially.- So if
google.com
hasns1 - ns4
, we'll have to send 4 sequential queries for the IP addresses.- This means resolving a domain will take longer in some cases (especially where upstream nameservers don't provide the IP addresses in
Additionals
. I extended the various--timeouts
to help. Usually these are provided inAdditionals
though and so there's no impact.I used the top 70k CrUX domains with default flags for both branch and
main
time head -n 70000 current.csv| ./zdns A --iterative
Phillip/93-domain-retries
main
Conclusion
With the caveat that this is a single workflow, we can see a 10% runtime improvement and 2.7% and 29% reduction in name resolution failures and timeouts, respectively.