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

Domain rules的设置能否继承默认的全局设置 #1861

Closed
quanljh opened this issue Nov 24, 2024 · 2 comments
Closed

Domain rules的设置能否继承默认的全局设置 #1861

quanljh opened this issue Nov 24, 2024 · 2 comments

Comments

@quanljh
Copy link

quanljh commented Nov 24, 2024

需求应用场景
Related to xiaorouji/openwrt-passwall#3519 (comment)

最新版的passwall 支持smartdns 模式
会生成下面的config 对于china domain list

domain-rules /domain-set:passwall-chnlist/ -nameserver default -nftset 

测速模式: 默认
nslookup baidu.com

With domain-rules /domain-set:passwall-chnlist/ -nameserver default -nftset
Log

[2024-11-24 15:44:23,305][DEBUG][     dns_server.c:3865] domain: baidu.com TTL: 67 IP: 39.156.66.10
[2024-11-24 15:44:23,305][DEBUG][     dns_server.c:3865] domain: baidu.com TTL: 67 IP: 110.242.68.66
[2024-11-24 15:44:23,305][ INFO][     dns_server.c:2613] result: baidu.com, qtype: 1, rtt: -0.1 ms, 39.156.66.10
[2024-11-24 15:44:23,305][DEBUG][     dns_server.c:2336] reply baidu.com qtype: 1, rcode: 0, reply: 1
[2024-11-24 15:44:23,305][DEBUG][     dns_server.c:1189] result: baidu.com, rtt: -0.1 ms, 39.156.66.10
[2024-11-24 15:44:23,305][DEBUG][     dns_server.c:1666] cache baidu.com qtype: 1 ttl: 3600

With domain-rules /domain-set:passwall-chnlist/ -nameserver default -nftset --speed-check-mode ping,tcp:80
Log

[2024-11-24 15:56:54,842][DEBUG][     dns_server.c:3865] domain: baidu.com TTL: 307 IP: 110.242.68.66
[2024-11-24 15:56:54,842][DEBUG][     dns_server.c:3865] domain: baidu.com TTL: 307 IP: 39.156.66.10
[2024-11-24 15:56:54,842][DEBUG][     dns_client.c:1600] result: baidu.com, qtype: 1, has-result: 1, id 12369
[2024-11-24 15:56:54,865][DEBUG][     dns_server.c:3147] from 39.156.66.10: seq=1 time=326, lasttime=-1 id=36714
[2024-11-24 15:56:54,865][ INFO][     dns_server.c:2613] result: baidu.com, qtype: 1, rtt: 32.6 ms, 39.156.66.10
[2024-11-24 15:56:54,865][DEBUG][     dns_server.c:2336] reply baidu.com qtype: 1, rcode: 0, reply: 1
[2024-11-24 15:56:54,865][DEBUG][     dns_server.c:1189] result: baidu.com, rtt: 32.6 ms, 39.156.66.10
[2024-11-24 15:56:54,865][DEBUG][     dns_server.c:1666] cache baidu.com qtype: 1 ttl: 3600

可以观察到rtt 的变化,第一个没有执行测速,看起来不指定speed-check-mode 就不会执行测速

代码里好像也没有继承默认设置的处理

smartdns/src/dns_conf.c

Lines 4931 to 4942 in fdc1a41

case 'c': {
const char *check_mode = optarg;
if (check_mode == NULL) {
goto errout;
}
if (_conf_domain_rule_speed_check(domain, check_mode) != 0) {
tlog(TLOG_ERROR, "add check-speed-rule rule failed.");
goto errout;
}
break;

建议的方案
Domain rules 可以继承默认的全局和custom.conf里面的设置,比如
如果custom.conf 设置了
speed-check-mode ping,tcp:80
Domain rule 可以自动继承这个speed-check-mode 而无需手动添加

设备信息

  1. 固件型号
    Openwrt 23.05
  2. 软件
    luci-smartdns
@quanljh
Copy link
Author

quanljh commented Nov 25, 2024

Will reopen once i got enough information

@quanljh quanljh closed this as not planned Won't fix, can't repro, duplicate, stale Nov 25, 2024
@quanljh
Copy link
Author

quanljh commented Nov 26, 2024

My fault, false alarm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant