Skip to content
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

内置dns处理regexp规则时,判断顺序(优先级)错误。 #1127

Closed
simplerick-simplefun opened this issue Jul 2, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@simplerick-simplefun
Copy link

simplerick-simplefun commented Jul 2, 2022

使用的版本:
Xray-core v1.5.5
Xray-android-arm64-v8a.zip

问题:(注:此问题在v2fly最新稳定版中也存在)
对于mtalk.google.com,我设置的dns规则第一条是regexp:.*mtalk.google.com,第二条是geosite:google,第三条是geosite:geolocation-!cn。
但是实际match的时候,顺序变成了geosite:google、geosite:geolocation-!cn、regexp:.*mtalk.google.com,导致实际选择的dns服务器错误。

[Debug] app/dns: domain mtalk.google.com matches following rules: [geosite:google(DNS idx:2) geosite:geolocation-!cn(DNS idx:5) regexp:.*mtalk.google.com(DNS idx:0)]
[Debug] app/dns: domain mtalk.google.com will use DNS in order: [DOH//8.8.8.8 DOH//8.8.8.8 DOHL//120.53.53.53 DOHL//120.53.53.53]

我的conf.json:

{
  "dns": {
    "servers": [
      {
        "address": "https+local://120.53.53.53/dns-query",
        "skipFallback": false,
        "domains": [
          "regexp:.*mtalk.google.com"
        ]
      },
      {
        "address": "https://8.8.8.8/dns-query",
        "skipFallback": true,
        "domains": [
          "geosite:google"
        ]
      },
      {

        "address": "https+local://8.8.8.8/dns-query",
        "skipFallback": true,
        "domains": [
          "geosite:geolocation-!cn"
        ]
      }
    ]
  }
}

相关文档:
https://xtls.github.io/config/dns.html#dns-%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B
https://www.v2fly.org/config/dns.html#dns-%E5%A4%84%E7%90%86%E6%B5%81%E7%A8%8B

没有命中 hosts,但命中了某(几)个 DNS 服务器中的 domains 域名列表,则按照命中的规则的优先级,依次使用该规则对应的 DNS 服务器进行查询。

@simplerick-simplefun simplerick-simplefun changed the title 内置dns处理regexp规则时,判断顺序错误。 内置dns处理regexp规则时,判断顺序(优先级)错误。 Jul 2, 2022
@yuhan6665 yuhan6665 added the bug Something isn't working label Jul 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants