luci-app-mosdns: Add DNS Servers concurrency setting

This commit is contained in:
sbwml 2023-03-27 09:55:14 +08:00
parent 9d76341fb8
commit 4b25902d76
5 changed files with 17 additions and 0 deletions

View File

@ -88,6 +88,12 @@ o:depends("configfile", "/etc/mosdns/config.yaml")
s:tab("advanced", translate("Advanced Options")) s:tab("advanced", translate("Advanced Options"))
o = s:taboption("advanced", Value, "concurrent", translate("Concurrent"), translate("DNS query request concurrency, The number of upstream DNS servers that are allowed to initiate requests at the same time"))
o.datatype = "and(uinteger,min(1))"
o.datatype = "and(uinteger,max(3))"
o.default = "1"
o:depends("configfile", "/etc/mosdns/config.yaml")
o = s:taboption("advanced", Flag, "enable_pipeline", translate("TCP/DoT Connection Multiplexing"), translate("Enable TCP/DoT RFC 7766 new Query Pipelining connection multiplexing mode")) o = s:taboption("advanced", Flag, "enable_pipeline", translate("TCP/DoT Connection Multiplexing"), translate("Enable TCP/DoT RFC 7766 new Query Pipelining connection multiplexing mode"))
o.rmempty = false o.rmempty = false
o.default = false o.default = false

View File

@ -142,6 +142,12 @@ msgstr "Bootstrap DNS 服务器用于解析您指定为上游的 DoH / DoT 解
msgid "Remote DNS" msgid "Remote DNS"
msgstr "远程 DNS" msgstr "远程 DNS"
msgid "Concurrent"
msgstr "DNS 服务器并发数(默认 1"
msgid "DNS query request concurrency, The number of upstream DNS servers that are allowed to initiate requests at the same time"
msgstr "DNS 查询请求并发数,允许同时发起请求的上游 DNS 服务器数量"
msgid "TCP/DoT Connection Multiplexing" msgid "TCP/DoT Connection Multiplexing"
msgstr "TCP/DoT 连接复用" msgstr "TCP/DoT 连接复用"

View File

@ -13,6 +13,7 @@ config mosdns 'config'
option cache_size '20000' option cache_size '20000'
option cache_survival_time '86400' option cache_survival_time '86400'
option dump_file '0' option dump_file '0'
option concurrent '1'
option minimal_ttl '0' option minimal_ttl '0'
option maximum_ttl '0' option maximum_ttl '0'
option custom_local_dns '0' option custom_local_dns '0'

View File

@ -55,6 +55,7 @@ get_config() {
config_get bootstrap_dns $1 bootstrap_dns "119.29.29.29" config_get bootstrap_dns $1 bootstrap_dns "119.29.29.29"
config_get enabled_api $1 enabled_api 0 config_get enabled_api $1 enabled_api 0
config_get listen_port_api $1 listen_port_api 9091 config_get listen_port_api $1 listen_port_api 9091
config_get concurrent $1 concurrent 1
} }
init_yaml() { init_yaml() {
@ -70,6 +71,7 @@ init_yaml() {
s,cache_survival_time,$cache_survival_time,g; \ s,cache_survival_time,$cache_survival_time,g; \
s,minimal_ttl_custom,$minimal_ttl_custom,g; \ s,minimal_ttl_custom,$minimal_ttl_custom,g; \
s,maximum_ttl_custom,$maximum_ttl_custom,g; \ s,maximum_ttl_custom,$maximum_ttl_custom,g; \
s,concurrent_num,$concurrent,g; \
s,adblock,$adlist,g;s,remote_dns_pipeline,$enable_pipeline,g" $DEFAULT_CONF > $CONF s,adblock,$adlist,g;s,remote_dns_pipeline,$enable_pipeline,g" $DEFAULT_CONF > $CONF
echo "${local_dns}" > $TMPDIR/local_dns.txt echo "${local_dns}" > $TMPDIR/local_dns.txt
echo "${remote_dns}" > $TMPDIR/remote_dns.txt echo "${remote_dns}" > $TMPDIR/remote_dns.txt

View File

@ -83,12 +83,14 @@ plugins:
- tag: forward_local - tag: forward_local
type: forward type: forward
args: args:
concurrent: concurrent_num
upstreams: upstreams:
- addr: local_dns - addr: local_dns
- tag: forward_remote - tag: forward_remote
type: forward type: forward
args: args:
concurrent: concurrent_num
upstreams: upstreams:
- addr: remote_dns - addr: remote_dns