mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-09 07:30:56 +00:00
Add IPv6 resolver test
This commit is contained in:
parent
086f0790fc
commit
9f4ef66f41
@ -264,9 +264,11 @@ daemon_check() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
testResolver() {
|
testResolver() {
|
||||||
header_write "Resolver Functions Check"
|
|
||||||
local protocol="${1}"
|
local protocol="${1}"
|
||||||
|
header_write "Resolver Functions Check (IPv${protocol})"
|
||||||
local IP="${2}"
|
local IP="${2}"
|
||||||
|
local g_addr
|
||||||
|
local l_addr
|
||||||
local url
|
local url
|
||||||
local testurl
|
local testurl
|
||||||
local localdig
|
local localdig
|
||||||
@ -275,8 +277,10 @@ testResolver() {
|
|||||||
|
|
||||||
if [[ ${protocol} == "6" ]]; then
|
if [[ ${protocol} == "6" ]]; then
|
||||||
g_addr="2001:4860:4860::8888"
|
g_addr="2001:4860:4860::8888"
|
||||||
|
l_addr="::1"
|
||||||
else
|
else
|
||||||
g_addr="8.8.8.8"
|
g_addr="8.8.8.8"
|
||||||
|
l_addr="127.0.0.1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Find a blocked url that has not been whitelisted.
|
# Find a blocked url that has not been whitelisted.
|
||||||
@ -285,19 +289,19 @@ testResolver() {
|
|||||||
testurl="${url:-doubleclick.com}"
|
testurl="${url:-doubleclick.com}"
|
||||||
|
|
||||||
|
|
||||||
log_write "Resolution of ${testurl} from Pi-hole (localhost):"
|
log_write "Resolution of ${testurl} from Pi-hole (${l_addr}):"
|
||||||
if localdig=$(dig -"${protocol}" "${testurl}" @localhost +short); then
|
if localdig=$(dig -"${protocol}" "${testurl}" @${l_addr} +short); then
|
||||||
log_write "${localdig}"
|
log_write "${localdig}"
|
||||||
else
|
else
|
||||||
log_write "Failed to resolve ${testurl} on Pi-hole"
|
log_write "Failed to resolve ${testurl} on Pi-hole (${l_addr})"
|
||||||
fi
|
fi
|
||||||
log_write ""
|
log_write ""
|
||||||
|
|
||||||
log_write "Resolution of ${testurl} from Pi-hole (direct IP):"
|
log_write "Resolution of ${testurl} from Pi-hole (${IP}):"
|
||||||
if piholedig=$(dig -"${protocol}" "${testurl}" @"${IP}" +short); then
|
if piholedig=$(dig -"${protocol}" "${testurl}" @"${IP}" +short); then
|
||||||
log_write "${piholedig}"
|
log_write "${piholedig}"
|
||||||
else
|
else
|
||||||
log_write "Failed to resolve ${testurl} on Pi-hole"
|
log_write "Failed to resolve ${testurl} on Pi-hole (${IP})"
|
||||||
fi
|
fi
|
||||||
log_write ""
|
log_write ""
|
||||||
|
|
||||||
@ -306,7 +310,7 @@ testResolver() {
|
|||||||
if remotedig=$(dig -"${protocol}" "${testurl}" @${g_addr} +short); then
|
if remotedig=$(dig -"${protocol}" "${testurl}" @${g_addr} +short); then
|
||||||
log_write "${remotedig:-NXDOMAIN}"
|
log_write "${remotedig:-NXDOMAIN}"
|
||||||
else
|
else
|
||||||
log_write "Failed to resolve ${testurl} on ${g_addr}"
|
log_write "Failed to resolve ${testurl} on upstream server ${g_addr}"
|
||||||
fi
|
fi
|
||||||
log_write ""
|
log_write ""
|
||||||
|
|
||||||
@ -423,6 +427,7 @@ daemon_check dnsmasq domain
|
|||||||
daemon_check pihole-FTL 4711
|
daemon_check pihole-FTL 4711
|
||||||
checkProcesses
|
checkProcesses
|
||||||
testResolver 4 "${IPV4_ADDRESS%/*}"
|
testResolver 4 "${IPV4_ADDRESS%/*}"
|
||||||
|
testResolver 6 "${IPV6_ADDRESS%/*}"
|
||||||
debugLighttpd
|
debugLighttpd
|
||||||
|
|
||||||
files_check "${DNSMASQFILE}"
|
files_check "${DNSMASQFILE}"
|
||||||
|
Loading…
Reference in New Issue
Block a user