Coder Social home page Coder Social logo

Comments (12)

zfl9 avatar zfl9 commented on August 20, 2024

日志呢?

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

油管肯定走了trust上游(tag:gfw),看log,解析花了多长时间,我看你trust上游是这个127.0.0.1#11051

另外,dig自己测下 youtube.com 相关域名解析时间。

我没遇到这个问题。


先从dns解析日志入手,先测试chinadns-ng的解析结果以及时长,然后是127.0.0.1#11051的解析结果以及时长

先确定是不是dns问题,因为油管会走quic的,要排除是不是quic问题。

from chinadns-ng.

muziling avatar muziling commented on August 20, 2024
2024-04-18 08:58:16 E [Upstream.zig:191 do_send_tcp] connect(12, 'tcpi://127.0.0.1#11051') failed: (111) Connection refused

是我的上游只有udp协议,配置不加 udp:// 会导致时间很长,加了就没问题。
因为不支持tcp,配置又没有明确指定只走udp,tcp影响到了udp,感觉还有优化的空间。
看日志是先尝试tcp,不成功再走udp,所以时间很久。

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

因为客户端与chinadns-ng是tcp通信(可以从log观察到这一点),所以chinadns-ng与上游的查询协议也是tcp。

默认的无协议限定的上游 就是这个设定的,文档有说明。

如果上游明确不支持 tcp,那就加上 udp://


2024.03.07 版本起,支持 UDP + TCP 上游(根据查询方的传入协议决定)。
2024.03.07 版本起,可在上游地址前加上 tcp:// 来强制使用 TCP DNS。
2024.04.13 版本起,可在上游地址前加上 udp:// 来强制使用 UDP DNS。


相关issue:#153#160

from chinadns-ng.

muziling avatar muziling commented on August 20, 2024

感觉客户端不是用tcp通信的,我手机上用cnbeta客户端打开cnbeta也是一样的问题,第一次内容加载不出来,关掉APP再打开才行

2024-04-18 08:58:08 I [server.zig:305 QueryLog.query] query(id:49435, tag:gfw, qtype:28, 'github.com') from 192.168.222.200#51834
2024-04-18 08:58:08 I [server.zig:313 QueryLog.noaaaa] query(id:49435, tag:gfw, qtype:AAAA, 'github.com') filtered by rule: tag:gfw
2024-04-18 08:58:08 I [server.zig:305 QueryLog.query] query(id:23088, tag:gfw, qtype:1, 'github.com') from 192.168.222.200#50379
2024-04-18 08:58:08 I [server.zig:366 QueryLog.forward] forward query(qid:7, from:udp, 'github.com') to trust group
2024-04-18 08:58:08 I [Upstream.zig:511 Group.send] forward query(qid:7, from:udp) to upstream udpi://127.0.0.1#11051
2024-04-18 08:58:08 I [server.zig:561 ReplyLog.reply] reply(qid:7, tag:gfw, qtype:1, 'github.com') from udpi://127.0.0.1#11051 [accept]
2024-04-18 08:58:08 I [server.zig:561 ReplyLog.reply] reply(qid:7, tag:null, qtype:1, 'github.com') from udpi://127.0.0.1#11051 [ignore]
2024-04-18 08:58:08 I [server.zig:561 ReplyLog.reply] reply(qid:7, tag:null, qtype:1, 'github.com') from udpi://127.0.0.1#11051 [ignore]
2024-04-18 08:58:08 I [server.zig:206 service_tcp] new connection:9 from 192.168.222.200#50324
2024-04-18 08:58:08 I [server.zig:305 QueryLog.query] query(id:23088, tag:gfw, qtype:1, 'github.com') from 192.168.222.200#50324
2024-04-18 08:58:08 I [server.zig:366 QueryLog.forward] forward query(qid:8, from:tcp, 'github.com') to trust group
2024-04-18 08:58:08 I [Upstream.zig:511 Group.send] forward query(qid:8, from:tcp) to upstream tcpi://127.0.0.1#11051
2024-04-18 08:58:08 E [Upstream.zig:191 do_send_tcp] connect(10, 'tcpi://127.0.0.1#11051') failed: (111) Connection refused
2024-04-18 08:58:11 I [server.zig:206 service_tcp] close connection:8 from 192.168.222.200#50314
2024-04-18 08:58:11 W [server.zig:824 on_timeout] query(qid:5, id:13964, tag:gfw) from tcp://192.168.222.200#50314 [timeout]

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

forward query(qid:8, from:tcp, 'github.com')****

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

看到这个 from:tcp 没?
看到 [service_tcp] new connection:9 from 192.168.222.200#50324 没?

from chinadns-ng.

muziling avatar muziling commented on August 20, 2024

chrome浏览器用代理扩展和 手机APP,是否会产生tcp 的 dns请求不清楚
总之就是上游协议一定一定要配置正确,否则就会出现这种问题。

这个最好在readme里提醒下

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

嗯,在上游配置那里,强调下这个问题。

from chinadns-ng.

muziling avatar muziling commented on August 20, 2024

非trust上游运营商的DNS也要指定udp://。。。。。

如果chinadns-ng不监听tcp可能就没问题,问题是默认监听了tcp

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

你可以使用 bind-port 53@udp 仅监听udp

from chinadns-ng.

zfl9 avatar zfl9 commented on August 20, 2024

已更新 readme。

from chinadns-ng.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.