Skip to content

Commit

Permalink
luci: add dns64 option
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Feb 21, 2023
1 parent a6cb606 commit c5ca3cc
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ rtt min/avg/max/mdev = 5.954/6.133/6.313/0.195 ms
1. **高性能、占用资源少**
多线程异步 IO 模式,cache 缓存查询结果。

1. **主流系统官方支持**
1. **主流系统官方支持**
主流路由系统官方软件源安装smartdns。

## 架构
Expand Down
2 changes: 1 addition & 1 deletion ReadMe_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ From the comparison, smartdns found the fastest IP address to visit www.baidu.co
1. **High performance, low resource consumption**
Multi-threaded asynchronous IO mode, cache cache query results.

1. **DNS domain forwarding**
1. **DNS domain forwarding**
Support DNS forwarding, ipset and nftables. Support setting the domain result to ipset and nftset set when speed check fails.

## Architecture
Expand Down
3 changes: 3 additions & 0 deletions package/luci-compat/files/luci/i18n/smartdns.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ msgstr "协议类型"
msgid "DNS domain result cache size"
msgstr "缓存DNS的结果,缓存大小,配置零则不缓存"

msgid "DNS64 Server Settings"
msgstr "DNS64服务器配置"

msgid "Description"
msgstr "描述"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ s.anonymous = true
s:tab("settings", translate("General Settings"))
s:tab("advanced", translate('Advanced Settings'))
s:tab("seconddns", translate("Second Server Settings"))
s:tab("dns64", translate("DNS64 Server Settings"))
s:tab("proxy", translate("Proxy Server Settings"))
s:tab("custom", translate("Custom Settings"))

Expand Down Expand Up @@ -371,6 +372,12 @@ function o.validate(self, value)
return value
end

----- dns64 server settings
o = s:taboption("dns64", Value, "dns64", translate("DNS64"));
o.placeholder = "64:ff9b::/96"
o.datatype = 'ip6addr'
o.rmempty = true

----- custom settings
custom = s:taboption("custom", Value, "Custom Settings",
translate(""),
Expand Down
3 changes: 3 additions & 0 deletions package/luci/files/luci/i18n/smartdns.zh-cn.po
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ msgstr "协议类型"
msgid "DNS domain result cache size"
msgstr "缓存DNS的结果,缓存大小,配置零则不缓存"

msgid "DNS64 Server Settings"
msgstr "DNS64服务器配置"

msgid "default"
msgstr "默认"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ return view.extend({
s.tab("settings", _("General Settings"));
s.tab("advanced", _('Advanced Settings'));
s.tab("seconddns", _("Second Server Settings"));
s.tab("dns64", _("DNS64 Server Settings"));
s.tab("files", _("Download Files Setting"), _("Download domain list files for domain-rule and include config files, please refresh the page after download to take effect."));
s.tab("proxy", _("Proxy Server Settings"));
s.tab("custom", _("Custom Settings"));
Expand Down Expand Up @@ -430,6 +431,14 @@ return view.extend({
o.rmempty = false;
o.default = o.disabled;

///////////////////////////////////////
// DNS64 Settings
///////////////////////////////////////
o = s.taboption("dns64", form.Value, "dns64", _("DNS64"));
o.placeholder = "64:ff9b::/96";
o.datatype = "ip6addr";
o.rempty = true;

///////////////////////////////////////
// download Files Settings
///////////////////////////////////////
Expand Down
6 changes: 5 additions & 1 deletion package/openwrt/files/etc/init.d/smartdns
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ load_service()
config_get port "$section" "port" "53"
config_get ipv6_server "$section" "ipv6_server" "1"
config_get tcp_server "$section" "tcp_server" "1"
config_get server_flags "$section" "server_flags" ""

config_get speed_check_mode "$section" "speed_check_mode" ""
[ ! -z "$speed_check_mode" ] && conf_append "speed-check-mode" "$speed_check_mode"
Expand Down Expand Up @@ -563,6 +564,9 @@ load_service()
config_get proxy_server "$section" "proxy_server" ""
[ -z "$proxy_server" ] || conf_append "proxy-server" "$proxy_server -name default-proxy"

config_get dns64 "$section" "dns64" ""
[ -z "$dns64" ] || conf_append "dns64" "$dns64"

config_get redirect "$section" "redirect" ""
config_get old_port "$section" "old_port" "0"
config_get old_enabled "$section" "old_enabled" "0"
Expand Down Expand Up @@ -629,7 +633,7 @@ load_service()
[ "$auto_set_dnsmasq" = "0" ] && [ "$old_auto_set_dnsmasq" = "1" ] && stop_forward_dnsmasq "$old_port" "0"
}

conf_append_bind "$port" "$device" "$tcp_server" "$ipv6_server" "$ARGS"
conf_append_bind "$port" "$device" "$tcp_server" "$ipv6_server" "$server_flags"

load_second_server "$section"

Expand Down

0 comments on commit c5ca3cc

Please sign in to comment.