DNS: Extend hosts Abilities#4673
Merged
Conversation
Member
|
第一个可以加 隔壁那个rcode也行 |
Collaborator
Author
|
As I said, appending-results only adds complexity, we can set multiple-IPs for each result, so there is no need to appending-results, also, appending-results causes the problem I mentioned. |
Member
|
|
This was referenced May 6, 2025
Closed
This was referenced May 7, 2025
Closed
1 task
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.
number 1:
currently we cannot set
[]for a domain in hosts.(the code return error)but we may want to return no IP (EmptyResponse) for a domain, for example return no IP for ads-domains to block them:
so i extend ability to set
[]or""for a domain when we want no IP to return for a domain (EmptyResponse)number 2:
suppose we want to return "216.239.38.120" for "youtube.com" but return "216.239.38.119" for other google sites, so we set:
But the code accumulates the results, and we will eventually have:
"youtube.com": ["216.239.38.120","216.239.38.119"]so we don't get the desired result.
so we should not accumulate matched-results, We should return the first matched-result.
because each matched-result can have multiple IPs, so there is no need to accumulate the matched-results.
and accumulating the matched-results only causes such problems.
as a result, now, the first matched-result is returned for a domain in hosts, Instead of accumulating all the matched-results.