diff --git a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua index 41cdb2e..0dedd9b 100644 --- a/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua +++ b/luci-app-mosdns/luasrc/model/cbi/mosdns/basic.lua @@ -51,17 +51,6 @@ custom_local_dns:value("114.114.115.115", "114.114.115.115 (114DNS Secondary)") custom_local_dns:value("180.76.76.76", "180.76.76.76 (Baidu DNS)") custom_local_dns:depends("custom_local_dns", "1") -custom_local_dns = s:option(ListValue, "bootstrap_dns", translate("Bootstrap DNS servers"), translate("Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams")) -custom_local_dns:value("119.29.29.29", "119.29.29.29 (DNSPod Primary)") -custom_local_dns:value("119.28.28.28", "119.28.28.28 (DNSPod Secondary)") -custom_local_dns:value("223.5.5.5", "223.5.5.5 (AliDNS Primary)") -custom_local_dns:value("223.6.6.6", "223.6.6.6 (AliDNS Secondary)") -custom_local_dns:value("114.114.114.114", "114.114.114.114 (114DNS Primary)") -custom_local_dns:value("114.114.115.115", "114.114.115.115 (114DNS Secondary)") -custom_local_dns:value("180.76.76.76", "180.76.76.76 (Baidu DNS)") -custom_local_dns.default = "119.29.29.29" -custom_local_dns:depends("custom_local_dns", "1") - remote_dns = s:option(DynamicList, "remote_dns", translate("Remote DNS")) remote_dns:value("tls://1.1.1.1", "1.1.1.1 (CloudFlare DNS)") remote_dns:value("tls://1.0.0.1", "1.0.0.1 (CloudFlare DNS)") @@ -74,6 +63,17 @@ remote_dns:value("tls://208.67.222.222", "208.67.222.222 (Open DNS)") remote_dns:value("tls://208.67.220.220", "208.67.220.220 (Open DNS)") remote_dns:depends( "configfile", "/etc/mosdns/config.yaml") +bootstrap_dns = s:option(ListValue, "bootstrap_dns", translate("Bootstrap DNS servers"), translate("Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams")) +bootstrap_dns:value("119.29.29.29", "119.29.29.29 (DNSPod Primary)") +bootstrap_dns:value("119.28.28.28", "119.28.28.28 (DNSPod Secondary)") +bootstrap_dns:value("223.5.5.5", "223.5.5.5 (AliDNS Primary)") +bootstrap_dns:value("223.6.6.6", "223.6.6.6 (AliDNS Secondary)") +bootstrap_dns:value("114.114.114.114", "114.114.114.114 (114DNS Primary)") +bootstrap_dns:value("114.114.115.115", "114.114.115.115 (114DNS Secondary)") +bootstrap_dns:value("180.76.76.76", "180.76.76.76 (Baidu DNS)") +bootstrap_dns.default = "119.29.29.29" +bootstrap_dns:depends( "configfile", "/etc/mosdns/config.yaml") + remote_dns_pipeline = s:option(Flag, "enable_pipeline", translate("Remote DNS Connection Multiplexing"), translate("Enable TCP/DoT RFC 7766 new Query Pipelining connection multiplexing mode")) remote_dns_pipeline.rmempty = false remote_dns_pipeline.default = false diff --git a/luci-app-mosdns/po/zh-cn/mosdns.po b/luci-app-mosdns/po/zh-cn/mosdns.po index 2c1ece7..2432f0c 100644 --- a/luci-app-mosdns/po/zh-cn/mosdns.po +++ b/luci-app-mosdns/po/zh-cn/mosdns.po @@ -122,7 +122,7 @@ msgid "Bootstrap DNS servers" msgstr "Bootstrap DNS 服务器" msgid "Bootstrap DNS servers are used to resolve IP addresses of the DoH/DoT resolvers you specify as upstreams" -msgstr "Bootstrap DNS 服务器用于解析所指定为上游的 DoH / DoT 解析器的 IP 地址" +msgstr "Bootstrap DNS 服务器用于解析你指定为上游的 DoH / DoT 解析器的 IP 地址" msgid "Remote DNS" msgstr "远程 DNS" diff --git a/luci-app-mosdns/root/etc/config/mosdns b/luci-app-mosdns/root/etc/config/mosdns index e488e5c..44558f1 100644 --- a/luci-app-mosdns/root/etc/config/mosdns +++ b/luci-app-mosdns/root/etc/config/mosdns @@ -16,6 +16,7 @@ config mosdns 'config' option maximum_ttl '0' option custom_local_dns '0' option enable_pipeline '0' + option bootstrap_dns '119.29.29.29' list remote_dns 'tls://8.8.8.8' list remote_dns 'tls://1.1.1.1' diff --git a/luci-app-mosdns/root/etc/init.d/mosdns b/luci-app-mosdns/root/etc/init.d/mosdns index 264640f..d33b8f1 100755 --- a/luci-app-mosdns/root/etc/init.d/mosdns +++ b/luci-app-mosdns/root/etc/init.d/mosdns @@ -52,7 +52,7 @@ init_yaml() { adlist=$(/usr/share/mosdns/mosdns.sh ad) [ $enable_pipeline = 1 ] && enable_pipeline=true || enable_pipeline=false local_dns=$(/usr/share/mosdns/mosdns.sh dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n",s,$i,s}' s=' ') - remote_dns=$(echo $remote_dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s enable_pipeline: '${enable_pipeline}'\n",s,$i,s}' s=' ') + remote_dns=$(echo $remote_dns | awk '{for(i=1;i<=NF;i++)printf "%s- addr: %s\n%s bootstrap: '${bootstrap_dns}'\n%s enable_pipeline: '${enable_pipeline}'\n",s,$i,s,s}' s=' ') sed "s,log_level,$log_level,g;s,log_file,$log_file,g; \ s,listen_port,$listen_port,g;s,cache_size,$cache_size,g; \ s,cache_survival_time,$cache_survival_time,g; \ @@ -64,7 +64,6 @@ init_yaml() { echo "${remote_dns}" > $tmpdir/remote_dns.txt sed -i -e '/- addr: local_dns/{r '$tmpdir/local_dns.txt -e';d};/- addr: remote_dns/{r '$tmpdir/remote_dns.txt -e';d}' \ $CONF - [ "$custom_local_dns" -eq 0 ] && sed -i "/bootstrap/d" $CONF rm -rf $tmpdir }