From 8ff338852ee2ba91c9146f48d93e1963fc68fe1b Mon Sep 17 00:00:00 2001 From: Nick Peng Date: Fri, 28 Dec 2018 19:57:48 +0800 Subject: [PATCH] Update LuCI configration --- ReadMe.md | 8 ++++---- ReadMe_zh-CN.md | 8 ++++---- etc/smartdns/smartdns.conf | 5 ++--- package/luci/files/luci/i18n/smartdns.zh-cn.po | 11 ++++++++++- .../luci/files/luci/model/cbi/smartdns/smartdns.lua | 4 ++-- .../luci/files/luci/model/cbi/smartdns/upstream.lua | 8 ++++++++ package/openwrt/files/etc/init.d/smartdns | 5 +++++ 7 files changed, 35 insertions(+), 14 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 930933e..18cd94a 100755 --- a/ReadMe.md +++ b/ReadMe.md @@ -89,7 +89,7 @@ From the comparison, smartdns found the fastest IP address to visit www.baidu.co Support standard Linux system (Raspberry Pi), openwrt system various firmware, ASUS router native firmware. 7. **Support IPV4, IPV6 dual stack** - Support IPV4, IPV6 network, support query A, AAAA record. + Support IPV4, IPV6 network, support query A, AAAA record, dual-stack IP selection. 8. **High performance, low resource consumption** Multi-threaded asynchronous IO mode, cache cache query results. @@ -388,9 +388,9 @@ Note: Merlin firmware is derived from ASUS firmware and can theoretically be use |audit-size|audit log size|128K|number+K,M,G|audit-size 128K |audit-num|archived audit log number|2|Integer|audit-num 2 |conf-file|additional conf file|None|File path|conf-file /etc/smartdns/smartdns.more.conf -|server|Upstream UDP DNS server|None|[ip][:port] [-blacklist-ip], Repeatable, blacklist-ip parameter represents filtering the result of IPs with blacklist-ip configuration.| server 8.8.8.8:53 -|server-tcp|Upstream TCP DNS server|None|[IP][:port] [-blacklist-ip], Repeatable, blacklist-ip parameter represents filtering the result of IPs with blacklist-ip configuration.| server-tcp 8.8.8.8:53 -|server-tls|Upstream TLS DNS server|None|[IP][:port] [-blacklist-ip], Repeatable, blacklist-ip parameter represents filtering the result of IPs with blacklist-ip configuration.| server-tls 8.8.8.8:853 +|server|Upstream UDP DNS server|None|[ip][:port] [-blacklist-ip][-check-edns], Repeatable, blacklist-ip parameter represents filtering the result of IPs with blacklist-ip configuration.| server 8.8.8.8:53 -blacklist-ip -check-edns +|server-tcp|Upstream TCP DNS server|None|[IP][:port] [-blacklist-ip][-check-edns], Repeatable, blacklist-ip parameter represents filtering the result of IPs with blacklist-ip configuration.| server-tcp 8.8.8.8:53 +|server-tls|Upstream TLS DNS server|None|[IP][:port] [-blacklist-ip][-check-edns], Repeatable, blacklist-ip parameter represents filtering the result of IPs with blacklist-ip configuration.| server-tls 8.8.8.8:853 |address|Domain IP address|None|address /domain/ip| address /www.example.com/1.2.3.4 |ipset|Domain IPSet|None|ipset /domain/ipset|ipset /www.example.com/pass |bogus-nxdomain|bogus IP address|None|[IP/subnet], Repeatable| bogus-nxdomain 1.2.3.4/16 diff --git a/ReadMe_zh-CN.md b/ReadMe_zh-CN.md index a54febb..463add1 100644 --- a/ReadMe_zh-CN.md +++ b/ReadMe_zh-CN.md @@ -89,7 +89,7 @@ rtt min/avg/max/mdev = 5.954/6.133/6.313/0.195 ms 支持标准Linux系统(树莓派),openwrt系统各种固件,华硕路由器原生固件。 7. **支持IPV4, IPV6双栈** - 支持IPV4,IPV6网络,支持查询A, AAAA记录。 + 支持IPV4,IPV6网络,支持查询A, AAAA记录,支持双栈IP速度优化。 8. **高性能,占用资源少** 多线程异步IO模式,cache缓存查询结果。 @@ -388,9 +388,9 @@ rtt min/avg/max/mdev = 5.954/6.133/6.313/0.195 ms |audit-size|审计大小|128K|数字+K,M,G|audit-size 128K |audit-num|审计归档个数|2|数字|audit-num 2 |conf-file|附加配置文件|无|文件路径|conf-file /etc/smartdns/smartdns.more.conf -|server|上游UDP DNS|无|[ip][:port] [-blacklist-ip],可重复,blacklist-ip参数指定使用blacklist-ip配置IP过滤结果| server 8.8.8.8:53 -blacklist-ip -|server-tcp|上游TCP DNS|无|[IP][:port] [-blacklist-ip],可重复,blacklist-ip参数指定使用blacklist-ip配置IP过滤结果| server-tcp 8.8.8.8:53 -|server-tls|上游TLS DNS|无|[IP][:port] [-blacklist-ip],可重复,blacklist-ip参数指定使用blacklist-ip配置IP过滤结果| server-tls 8.8.8.8:853 +|server|上游UDP DNS|无|[ip][:port] [-blacklist-ip][-check-edns],可重复,blacklist-ip参数指定使用blacklist-ip配置IP过滤结果| server 8.8.8.8:53 -blacklist-ip -check-edns +|server-tcp|上游TCP DNS|无|[IP][:port] [-blacklist-ip][-check-edns],可重复,blacklist-ip参数指定使用blacklist-ip配置IP过滤结果| server-tcp 8.8.8.8:53 +|server-tls|上游TLS DNS|无|[IP][:port] [-blacklist-ip][-check-edns],可重复,blacklist-ip参数指定使用blacklist-ip配置IP过滤结果| server-tls 8.8.8.8:853 |address|指定域名IP地址|无|address /domain/ip| address /www.example.com/1.2.3.4 |ipset|域名IPSET|None|ipset /domain/ipset|ipset /www.example.com/pass |bogus-nxdomain|假冒IP地址过滤|无|[ip/subnet],可重复| bogus-nxdomain 1.2.3.4/16 diff --git a/etc/smartdns/smartdns.conf b/etc/smartdns/smartdns.conf index 12c23f4..7bf629e 100644 --- a/etc/smartdns/smartdns.conf +++ b/etc/smartdns/smartdns.conf @@ -76,15 +76,14 @@ log-level info # audit-num 2 # remote udp dns server list -# server [IP]:[PORT] [-blacklist-ip] [-check-edns] [-check-ttl=[ttl]] +# server [IP]:[PORT] [-blacklist-ip] [-check-edns] # default port is 53 # -blacklist-ip: filter result with blacklist ip # -check-edns: result must exist edns RR, or discard result. -# -check-ttl: Check whether the TTL of result is equal, If not equal, discard the result, -check-ttl=0 for auto check TTL. # server 8.8.8.8 -blacklist-ip -check-edns # remote tcp dns server list -# server-tcp [IP]:[PORT] [-blacklist-ip] [-check-edns] +# server-tcp [IP]:[PORT] [-blacklist-ip] # default port is 53 # server-tcp 8.8.8.8 diff --git a/package/luci/files/luci/i18n/smartdns.zh-cn.po b/package/luci/files/luci/i18n/smartdns.zh-cn.po index 8cbbbab..925eb20 100644 --- a/package/luci/files/luci/i18n/smartdns.zh-cn.po +++ b/package/luci/files/luci/i18n/smartdns.zh-cn.po @@ -106,7 +106,7 @@ msgstr "上游服务器" msgid "Upstream Servers, support UDP, TCP protocol. Please configure multiple DNS servers, including multiple foreign DNS servers." msgstr "上游DNS服务器列表,支持UDP,TCP协议,请配置多个上游DNS服务器,包括多个国内外服务器" -msgid "DNS Server name" +msgid "DNS Server Name" msgstr "DNS服务器名称" msgid "port" @@ -130,6 +130,12 @@ msgstr "域名地址" msgid "IP Blacklist Filtering" msgstr "IP黑名单过滤" +msgid "Anti Answer Forgery" +msgstr "反回答伪造" + +msgid "anti answer forgery, if DNS does not work properly after enabling, please turn off this feature" +msgstr "反回答伪造,如果启用后DNS工作不正常,请关闭此功能。" + msgid "Filtering IP with blacklist" msgstr "使用IP黑名单过滤" @@ -154,6 +160,9 @@ msgstr "配置需要从指定域名服务器结果过滤的IP黑名单。" msgid "Technical Support" msgstr "技术支持" +msgid "If you like this software, please buy me a cup of coffee." +msgstr "如果本软件对你有帮助,请给作者加个蛋。" + msgid "SmartDNS official website" msgstr "SmartDNS官方网站" diff --git a/package/luci/files/luci/model/cbi/smartdns/smartdns.lua b/package/luci/files/luci/model/cbi/smartdns/smartdns.lua index 6e27728..cfd9abf 100644 --- a/package/luci/files/luci/model/cbi/smartdns/smartdns.lua +++ b/package/luci/files/luci/model/cbi/smartdns/smartdns.lua @@ -121,7 +121,7 @@ o.cfgvalue = function(...) end ---- name -s:option(Value, "name", translate("Name"), translate("DNS Server name")) +s:option(Value, "name", translate("DNS Server Name"), translate("DNS Server Name")) ---- IP address o = s:option(Value, "ip", translate("ip"), translate("DNS Server ip")) o.datatype = "ipaddr" @@ -187,7 +187,7 @@ end -- Doman addresss s = m:section(TypedSection, "smartdns", translate("Technical Support"), - translate("Technical Support")) + translate("If you like this software, please buy me a cup of coffee.")) s.anonymous = true o = s:option(Button, "web") diff --git a/package/luci/files/luci/model/cbi/smartdns/upstream.lua b/package/luci/files/luci/model/cbi/smartdns/upstream.lua index 451f61b..1f446ce 100644 --- a/package/luci/files/luci/model/cbi/smartdns/upstream.lua +++ b/package/luci/files/luci/model/cbi/smartdns/upstream.lua @@ -21,4 +21,12 @@ o.cfgvalue = function(...) return Flag.cfgvalue(...) or "0" end +---- anti-Answer-Forgery +o = s:option(Flag, "check_edns", translate("Anti Answer Forgery"), translate("anti answer forgery, if DNS does not work properly after enabling, please turn off this feature")) +o.rmempty = false +o.default = o.disabled +o.cfgvalue = function(...) + return Flag.cfgvalue(...) or "0" +end + return m \ No newline at end of file diff --git a/package/openwrt/files/etc/init.d/smartdns b/package/openwrt/files/etc/init.d/smartdns index da2cabe..3970418 100644 --- a/package/openwrt/files/etc/init.d/smartdns +++ b/package/openwrt/files/etc/init.d/smartdns @@ -118,6 +118,7 @@ load_server() config_get "type" "$section" "type" "udp" config_get "ip" "$section" "ip" "" config_get "blacklist_ip" "$section" "blacklist_ip" "0" + config_get "check_edns" "$section" "check_edns" "0" if [ "$enabled" = "0" ]; then return @@ -144,6 +145,10 @@ load_server() ADDITIONAL_ARGS="$ADDITIONAL_ARGS -blacklist-ip" fi + if [ "$check_edns" != "0" ]; then + ADDITIONAL_ARGS="$ADDITIONAL_ARGS -check-edns" + fi + conf_append "$SERVER" "$ip:$port $ADDITIONAL_ARGS" }