From 02653e45e9b4252edcec66f5c7126f2e5ed7d5c2 Mon Sep 17 00:00:00 2001 From: Alter Step Date: Sun, 31 Jul 2016 14:08:27 +0200 Subject: [PATCH] Explain --- .../DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh index f4d5e23..e02cd81 100755 --- a/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh +++ b/DNSCrypt-Preference-Pane/DNSCrypt/extra/usr/scripts/start-dnscrypt-proxy.sh @@ -41,9 +41,15 @@ try_resolver() { case "$line" in *Proxying\ from\ *) logger_debug "Proxy for [$description] is up" + +# This doesn't send anything to Apple, and any reliable domain name can be used -- +# The following line sends a common query to the chosen DNSCrypt resolver to +# check that it responds and can be used instead of leaving the mac without +# a working DNS configuration. answers=$(exec dig +time=1 +short +tries=2 -p $priority \ @"$INTERFACE_PROBES" www.apple.com. 2> /dev/null | \ egrep -ic '^[0-9.:]+$') + [ -r "$pid_file" ] && kill $(cat -- "$pid_file") if [ $answers -gt 0 ]; then logger_debug "Proxy for [$description] can be used"