Change NSLOOKUP to dig for resolver tests, add dnsmasq specific records check

This commit is contained in:
Dan Schaper 2016-09-28 10:14:47 -07:00
parent 5de179f1eb
commit 8466d0b681

View file

@ -216,12 +216,14 @@ function portCheck {
echo >> ${DEBUG_LOG} echo >> ${DEBUG_LOG}
} }
function testNslookup { function testResolver {
TESTURL="doubleclick.com" echo "############################################################" >> ${DEBUG_LOG}
echo "#######################################" >> ${DEBUG_LOG} echo "############ Resolver Functions Check ############" >> ${DEBUG_LOG}
echo "############ NSLookup Test ############" >> ${DEBUG_LOG} echo "############################################################" >> ${DEBUG_LOG}
echo "#######################################" >> ${DEBUG_LOG}
# Find a blocked url that has not been whitelisted. # Find a blocked url that has not been whitelisted.
TESTURL="doubleclick.com"
if [ -s "$WHITELISTMATCHES" ]; then if [ -s "$WHITELISTMATCHES" ]; then
while read -r line; do while read -r line; do
CUTURL=${line#*" "} CUTURL=${line#*" "}
@ -237,11 +239,18 @@ function testNslookup {
done < "$GRAVITYFILE" done < "$GRAVITYFILE"
fi fi
echo "NSLOOKUP of $TESTURL from Pi-hole:" >> ${DEBUG_LOG} echo "Resolution of $TESTURL from Pi-hole:" >> ${DEBUG_LOG}
nslookup "$TESTURL" >> ${DEBUG_LOG} dig "$TESTURL" @127.0.0.1>> ${DEBUG_LOG}
echo >> ${DEBUG_LOG} echo >> ${DEBUG_LOG}
echo "NSLOOKUP of $TESTURL from 8.8.8.8:" >> ${DEBUG_LOG} echo "Resolution of $TESTURL from 8.8.8.8:" >> ${DEBUG_LOG}
nslookup "$TESTURL" 8.8.8.8 >> ${DEBUG_LOG} dig "$TESTURL" @8.8.8.8 >> ${DEBUG_LOG}
echo >> ${DEBUG_LOG}
echo "Pi-hole dnsmasq specific records lookups" >> ${DEBUG_LOG}
echo "Cache Size:" >> ${DEBUG_LOG}
dig +short chaos txt cachesize.bind >> ${DEBUG_LOG}
echo "Upstream Servers:" >> ${DEBUG_LOG}
dig +short chaos txt servers.bind >> ${DEBUG_LOG}
echo >> ${DEBUG_LOG} echo >> ${DEBUG_LOG}
} }
@ -259,6 +268,7 @@ function checkProcesses {
echo " processes status:" >> ${DEBUG_LOG} echo " processes status:" >> ${DEBUG_LOG}
${SUDO} systemctl -l status "$i" >> "$DEBUG_LOG" ${SUDO} systemctl -l status "$i" >> "$DEBUG_LOG"
done done
echo >> ${DEBUG_LOG}
} }
function debugLighttpd { function debugLighttpd {
@ -301,8 +311,8 @@ distroCheck
ipCheck ipCheck
hostnameCheck hostnameCheck
portCheck portCheck
testNslookup
checkProcesses checkProcesses
testResolver
debugLighttpd debugLighttpd
echo "::: Writing dnsmasq.conf to debug log..." echo "::: Writing dnsmasq.conf to debug log..."