xiaorouji / openwrt-passwall2

1.36k stars 442 forks source link

远程DNS协议 为 FakeDNS 时 ,DNS直连规则有误 #89

Closed chika0801 closed 2 years ago

chika0801 commented 2 years ago

直连 DNS 协议: 自动

远程 DNS 协议:FakeDNS

生成的配置文件如下

 "dns": {
    "disableFallback": true,
    "queryStrategy": "UseIPv4",
    "disableFallbackIfMatch": true,
    "servers": [
      {
        "_flag": "default",
        "address": "fakedns"
      },
      {
        "_flag": "remote",
        "domains": [
          "geosite:category-ads-all",
          "geosite:geolocation-!cn"
        ],
        "address": "fakedns"
      },
      {
        "_flag": "direct",
        "port": 5333,
        "domains": [
          "geosite:apple-cn",
          "geosite:google-cn",
          "geosite:category-games@cn",
          "geosite:tld-cn",
          "geosite:cn"
        ],
        "address": "127.0.0.1"
      }
    ],

根据文档 https://www.v2fly.org/config/fakedns.html#%E4%B8%8E%E5%85%B6%E4%BB%96%E7%B1%BB%E5%9E%8B-dns-%E6%90%AD%E9%85%8D%E4%BD%BF%E7%94%A8

下面的对CN域名走直连的规则没有生效

      {
        "_flag": "direct",
        "port": 5333,
        "domains": [
          "geosite:apple-cn",
          "geosite:google-cn",
          "geosite:category-games@cn",
          "geosite:tld-cn",
          "geosite:cn"
        ],
        "address": "127.0.0.1"
      }

拿 ispip.clang.cn 进行测试,日志如下,确实是CN域名没走fakedns的。

2022/04/22 06:12:57 [Debug] [262551577] proxy/dokodemo: processing connection from: 127.0.0.1:37182
2022/04/22 06:12:57 [Info] [262551577] proxy/dokodemo: received request for 127.0.0.1:37182
2022/04/22 06:12:57 [Info] [262551577] app/dispatcher: taking detour [dns-out] for [udp:1.1.1.1:53]
2022/04/22 06:12:57 127.0.0.1:37182 accepted udp:1.1.1.1:53 [dns-out]
2022/04/22 06:12:57 [Info] [262551577] proxy/dns: handling DNS traffic to tcp:1.1.1.1:53
2022/04/22 06:12:57 [Debug] app/dns: domain ispip.clang.cn matches following rules: [geosite:tld-cn(DNS idx:2) geosite:cn(DNS idx:2)]
2022/04/22 06:12:57 [Debug] app/dns: domain ispip.clang.cn will use DNS in order: [UDP:127.0.0.1:5333]
2022/04/22 06:12:57 [Debug] app/dns: UDP:127.0.0.1:5333 querying DNS for: ispip.clang.cn.
2022/04/22 06:12:57 [Debug] transport/internet/udp: dispatch request to: udp:127.0.0.1:5333
2022/04/22 06:12:57 [Info] transport/internet/udp: establishing new connection for udp:127.0.0.1:5333
2022/04/22 06:12:57 [Info] app/dispatcher: taking detour [direct] for [udp:127.0.0.1:5333]
2022/04/22 06:12:57 [Info] proxy/freedom: opening connection to udp:127.0.0.1:5333
2022/04/22 06:12:57 DNS accepted udp:127.0.0.1:5333 [direct]
2022/04/22 06:12:57 [Debug] transport/internet: dialing to udp:127.0.0.1:5333
2022/04/22 06:12:57 [Debug] transport/internet/udp: UDP original destination: udp:119.29.29.29:53
2022/04/22 06:12:57 [Debug] transport/internet/udp: UDP original destination: udp:223.5.5.5:53
2022/04/22 06:12:57 [Debug] transport/internet/udp: UDP original destination: udp:117.50.10.10:5353
2022/04/22 06:12:57 [Debug] transport/internet/udp: UDP original destination: udp:52.80.52.52:5353
2022/04/22 06:12:57 192.168.2.188:19092 accepted udp:119.29.29.29:5353 [direct]
2022/04/22 06:12:57 192.168.2.188:21420 accepted udp:52.80.52.52:5353 [direct]
chika0801 commented 2 years ago

正确是应写成

      {
        "_flag": "direct",
        "port": 5333,
        "domains": [
          "geosite:apple-cn",
          "geosite:google-cn",
          "geosite:category-games@cn",
          "geosite:tld-cn",
          "geosite:cn"
        ],
        "address": "fakedns"
      },
      {
        "_flag": "direct",
        "port": 5333,
        "domains": [
          "geosite:apple-cn",
          "geosite:google-cn",
          "geosite:category-games@cn",
          "geosite:tld-cn",
          "geosite:cn"
        ],
        "address": "127.0.0.1"
      }
xiaorouji commented 2 years ago

这样用不了的

xiaorouji commented 2 years ago

本来就不推荐用FakeDNS

chika0801 commented 2 years ago

这样用不了的

那就没办法了。我以前在V2rayNG的自定义配置里,是按文档的要求写的,cn直连是第1次走到Fakedns上。

chika0801 commented 2 years ago

本来就不推荐用FakeDNS

谢谢你的软件,不添加麻烦了 再次感谢你的软件 。

Rashhz commented 2 years ago

你好,请问这个生成的配置文件的目录是什么?