Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

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

Open simplerick-simplefun opened this issue 3 years ago • 0 comments

使用的版本: 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 avatar Jul 02 '22 10:07 simplerick-simplefun