这个问题如何影响到你?
The nameserver-policy is a set dictionary is unordered, and when encountering a domain name that together belongs to
{ 'rule-set:category-ads-all_classical' , '+.us' , 'rule-set:geolocation-!cn' }
there is no top-to-bottom match order, which can cause to happen:
for a '+.us' URL,
If +.us takes precedence over rule-set, then unblocked ads.
If rule-set takes precedence over +.us, then US matches don't work anymore
(There are more complex implications at the end)
你想实现什么功能?
Add priority determination inside current nameserver-policy.
For example, Arrays are sequential, just like rules
目前 Mihomo Core 的行为是什麽
The set dictionary of nameserver-policy is not in order, and match priority may depend on the level of detail of the domain wildcard, rather than the policy order.
Currently the only order for DNS resolution is [direct-nameserver, nameserver-policy, nameserver, fallback].
The simple example above is used to illustrate the problem and can be solved by the following as a temporary alternative
But rule-set:geolocation-!cn seems to work better, no omissions
But fallback is limited and geosite is about to be deprecated, can't use ruleset.
But four [direct-nameserver, nameserver-policy, nameserver, fallback] cannot express complex DNS logic.
In complex DNS logic policy has intersection, especially the logic appears to be application-oriented set, the following logic example in [direct-nameserver, nameserver-policy, nameserver, fallback] can not be expressed:
Assuming that bilibili.com appears in bilibili_domain, domestic_classical, (even category-ads-all_classical) at the same time, the resolution priority is all about luck
Verify steps
Description
For this simple example.
这个问题如何影响到你? The nameserver-policy is a set dictionary is unordered, and when encountering a domain name that together belongs to { 'rule-set:category-ads-all_classical' , '+.us' , 'rule-set:geolocation-!cn' } there is no top-to-bottom match order, which can cause to happen:
for a '+.us' URL, If +.us takes precedence over rule-set, then unblocked ads. If rule-set takes precedence over +.us, then US matches don't work anymore (There are more complex implications at the end)
你想实现什么功能? Add priority determination inside current nameserver-policy. For example, Arrays are sequential, just like rules
目前 Mihomo Core 的行为是什麽 The set dictionary of nameserver-policy is not in order, and match priority may depend on the level of detail of the domain wildcard, rather than the policy order. Currently the only order for DNS resolution is [direct-nameserver, nameserver-policy, nameserver, fallback]. The simple example above is used to illustrate the problem and can be solved by the following as a temporary alternative
But rule-set:geolocation-!cn seems to work better, no omissions But fallback is limited and geosite is about to be deprecated, can't use ruleset. But four [direct-nameserver, nameserver-policy, nameserver, fallback] cannot express complex DNS logic.
In complex DNS logic policy has intersection, especially the logic appears to be application-oriented set, the following logic example in [direct-nameserver, nameserver-policy, nameserver, fallback] can not be expressed:
Assuming that bilibili.com appears in bilibili_domain, domestic_classical, (even category-ads-all_classical) at the same time, the resolution priority is all about luck
Possible Solution