1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +00:00

Protocol specific records checks.

Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
Dan Schaper 2017-03-04 15:16:33 -08:00
parent 2547cc4c8d
commit 6f2fb57c08
No known key found for this signature in database
GPG Key ID: 572E999E385B7BFC

View File

@ -278,9 +278,11 @@ testResolver() {
if [[ ${protocol} == "6" ]]; then
g_addr="2001:4860:4860::8888"
l_addr="::1"
r_type="AAAA"
else
g_addr="8.8.8.8"
l_addr="127.0.0.1"
r_type="A"
fi
# Find a blocked url that has not been whitelisted.
@ -290,7 +292,7 @@ testResolver() {
log_write "Resolution of ${testurl} from Pi-hole (${l_addr}):"
if localdig=$(dig -"${protocol}" "${testurl}" @${l_addr} +short); then
if localdig=$(dig -"${protocol}" "${testurl}" @${l_addr} +short "${r_type}"); then
log_write "${localdig}"
else
log_write "Failed to resolve ${testurl} on Pi-hole (${l_addr})"
@ -298,7 +300,7 @@ testResolver() {
log_write ""
log_write "Resolution of ${testurl} from Pi-hole (${IP}):"
if piholedig=$(dig -"${protocol}" "${testurl}" @"${IP}" +short); then
if piholedig=$(dig -"${protocol}" "${testurl}" @"${IP}" +short "${r_type}"); then
log_write "${piholedig}"
else
log_write "Failed to resolve ${testurl} on Pi-hole (${IP})"
@ -307,7 +309,7 @@ testResolver() {
log_write "Resolution of ${testurl} from ${g_addr}:"
if remotedig=$(dig -"${protocol}" "${testurl}" @${g_addr} +short); then
if remotedig=$(dig -"${protocol}" "${testurl}" @${g_addr} +short "${r_type}"); then
log_write "${remotedig:-NXDOMAIN}"
else
log_write "Failed to resolve ${testurl} on upstream server ${g_addr}"