diff --git a/luci-app-passwall/root/usr/share/passwall/app.sh b/luci-app-passwall/root/usr/share/passwall/app.sh index 8291d0569..0f86f573b 100755 --- a/luci-app-passwall/root/usr/share/passwall/app.sh +++ b/luci-app-passwall/root/usr/share/passwall/app.sh @@ -423,7 +423,7 @@ run_chinadns_ng() { ([ -n "$_chnlist" ] || [ -n "$_gfwlist" ]) && [ -s "${RULES_PATH}/gfwlist" ] && { local _gfwlist_file="${TMP_PATH}/chinadns_gfwlist" cp -a "${RULES_PATH}/gfwlist" "${_gfwlist_file}" - _extra_param="${_extra_param} -g ${_gfwlist_file}" + _extra_param="${_extra_param} -g ${_gfwlist_file} -A gfwlist,gfwlist6" #当只有使用gfwlist模式时设置默认DNS为本地直连 [ -n "$_gfwlist" ] && [ -z "$_chnlist" ] && _default_tag="chn" } diff --git a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua index 667d6ca80..713fab8aa 100644 --- a/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua +++ b/luci-app-passwall/root/usr/share/passwall/helper_dnsmasq_add.lua @@ -291,24 +291,29 @@ if not fs.access(CACHE_DNS_PATH) then --如果没有使用回国模式 if not returnhome then if fs.access("/usr/share/passwall/rules/gfwlist") then - local gfwlist_str = sys.exec('cat /usr/share/passwall/rules/gfwlist | grep -v -E "^#" | grep -v -E "' .. excluded_domain_str .. '"') - for line in string.gmatch(gfwlist_str, "[^\r\n]+") do - if line ~= "" then - local ipset_flag = setflag_4 .. "gfwlist," .. setflag_6 .. "gfwlist6" - if NO_PROXY_IPV6 == "1" then - ipset_flag = setflag_4 .. "gfwlist" - set_domain_address(line, "::") + fwd_dns = TUN_DNS + if CHNROUTE_MODE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then + fwd_dns = nil + else + local ipset_flag = setflag_4 .. "gfwlist," .. setflag_6 .. "gfwlist6" + if NO_PROXY_IPV6 == "1" then + ipset_flag = setflag_4 .. "gfwlist" + end + if not only_global then + if REMOTE_FAKEDNS == "1" then + ipset_flag = nil end - if not only_global then - fwd_dns = TUN_DNS - if CHNROUTE_MODE_DEFAULT_DNS == "chinadns_ng" and CHINADNS_DNS ~= "0" then - fwd_dns = nil + end + local gfwlist_str = sys.exec('cat /usr/share/passwall/rules/gfwlist | grep -v -E "^#" | grep -v -E "' .. excluded_domain_str .. '"') + for line in string.gmatch(gfwlist_str, "[^\r\n]+") do + if line ~= "" then + if NO_PROXY_IPV6 == "1" then + set_domain_address(line, "::") end - if REMOTE_FAKEDNS == "1" then - ipset_flag = nil + if not only_global then + set_domain_dns(line, fwd_dns) + set_domain_ipset(line, ipset_flag) end - set_domain_dns(line, fwd_dns) - set_domain_ipset(line, ipset_flag) end end end