summaryrefslogtreecommitdiff
path: root/net/https-dns-proxy/files/https-dns-proxy.init
diff options
context:
space:
mode:
authorStan Grishin <stangri@melmac.ca>2022-04-24 06:05:03 +0000
committerStan Grishin <stangri@melmac.ca>2022-04-25 01:13:48 +0000
commit5347139ee7747499a9f396db39b16c3d6f64d285 (patch)
tree1a46c79235aec7d6a608c6edabfa7d8bc1c1dddd /net/https-dns-proxy/files/https-dns-proxy.init
parent520c1f4687371688ee37d86e96f5cf2036998db1 (diff)
https-dns-proxy: 2021-11-22-3: add support for Canary Domains
Fixes https://github.com/stangri/source.openwrt.melmac.net/issues/155. Background: https://support.mozilla.org/en-US/kb/canary-domain-use-application-dnsnet Signed-off-by: Stan Grishin <stangri@melmac.ca>
Diffstat (limited to 'net/https-dns-proxy/files/https-dns-proxy.init')
-rwxr-xr-xnet/https-dns-proxy/files/https-dns-proxy.init8
1 files changed, 7 insertions, 1 deletions
diff --git a/net/https-dns-proxy/files/https-dns-proxy.init b/net/https-dns-proxy/files/https-dns-proxy.init
index 3bf85453f..0b9a620a5 100755
--- a/net/https-dns-proxy/files/https-dns-proxy.init
+++ b/net/https-dns-proxy/files/https-dns-proxy.init
@@ -22,6 +22,7 @@ readonly _OK_='\033[0;32m\xe2\x9c\x93\033[0m'
readonly _FAIL_='\033[0;31m\xe2\x9c\x97\033[0m'
readonly PROG=/usr/sbin/https-dns-proxy
readonly DEFAULT_BOOTSTRAP='1.1.1.1,1.0.0.1,2606:4700:4700::1111,2606:4700:4700::1001,8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844'
+readonly canaryDomains='use-application-dns.net'
dnsmasqConfig=''; forceDNS=''; forceDNSPorts='';
str_contains() { [ -n "$1" ] &&[ -n "$2" ] && [ "${1//$2}" != "$1" ]; }
@@ -171,7 +172,6 @@ start_instance() {
procd_close_instance
if [ "$?" ]; then
- forceDNS=0
config_get listen_addr "$cfg" 'listen_addr' '127.0.0.1'
config_get listen_port "$cfg" 'listen_port' "$port"
if [ "$dnsmasqConfig" = '*' ]; then
@@ -188,6 +188,7 @@ start_instance() {
fi
output_ok
port="$((port+1))"
+ forceDNS=0
else
output_fail
fi
@@ -244,6 +245,11 @@ dnsmasq_doh_server() {
local cfg="$1" param="$2" address="${3:-127.0.0.1}" port="$4" i
case "$param" in
add)
+ if [ "$forceDNS" -ne 0 ]; then
+ for i in $canaryDomains; do
+ uci_add_list_if_new "dhcp.${cfg}.server" "/${i}/"
+ done
+ fi
case $address in
0.0.0.0|::ffff:0.0.0.0) address='127.0.0.1';;
::) address='::1';;