dae icon indicating copy to clipboard operation
dae copied to clipboard

[Bug Report] 上游个别DNS超时会影响其余DNS速度

Open HurryYU opened this issue 7 months ago • 6 comments

Checks

  • [X] I have searched the existing issues
  • [X] I have read the documentation
  • [X] Is it your first time sumbitting an issue

Current Behavior

当上游任意dns超时的时候,会导致使用上游其它dns响应速度减慢

Expected Behavior

上游dns间互不影响,当其中一个dns地址出现问题后,不影响其它程序使用其它dns

Steps to Reproduce

我的dns配置如下:

dns {
    upstream {
        alidns: 'udp://223.5.5.5:53'
        googledns: 'tcp+udp://8.8.8.8:53'
    }
    routing {
        request {
            qname(geosite:category-ads-all) -> reject
            qname(geosite:github) -> googledns
            qname(geosite:telegram) -> googledns
            qname(geosite:gfw) -> googledns
            fallback: alidns
        }
        response {
            upstream(googledns) -> accept
            ip(geoip:private) && !qname(geosite:cn) -> googledns
            fallback: accept
       }
    }
}

route中我会让8.8.8.8通过xray走国外线路.现在,将xray程序关闭,即googledns(8.8.8.8)会timeout.

此时,使用nslookup www.google.com,确实得到超时的输出:

nslookup www.google.com
;; communications error to 127.0.0.53#53: timed out

此时查看dae日志,也确实有打印相关日志:

level=warning msg="handlePkt: failed to dial '8.8.8.8:53': [socks5]: dial to localhost:10808 error: dial tcp <nil>->[::1]:10808: connect: connection refused"

问题是一旦出现了超时的情况后,alidns也会受到影响,即其它程序访问的是国内域名,dae是会交给alidns来解析的,但速度明显会慢很多.

比如ping,nslookup国内域名,都会出现较大的延时才会输出结果:

nslookup www.baidu.com
;; communications error to 127.0.0.53#53: timed out
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
www.baidu.com   canonical name = www.a.shifen.com.
Name:   www.a.shifen.com
Address: 183.2.172.42
Name:   www.a.shifen.com
Address: 183.2.172.185
Name:   www.a.shifen.com
Address: 240e:ff:e020:966:0:ff:b042:f296
Name:   www.a.shifen.com
Address: 240e:ff:e020:9ae:0:ff:b014:8e8b

上面的输出日志可见,是经历过一次超时后才正常输出的.同理,ping也有很大的延迟才返回结果.

当我关闭dae,或是从来不让dae代理会超时的dns流量时,此现象消失

期望得到的解决是:个别dns超时不会影响到其它正常dns

Environment

  • Dae version 6.0-7.0:
  • OS Fedora Linux 40 (Workstation Edition):
  • Kernel 6.9.9-200.fc40.x86_64:

Anything else?

No response

HurryYU avatar Jul 23 '24 04:07 HurryYU