mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-24 13:50:17 +00:00
IPv4 DNS tests
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
6cd4ff6d68
commit
709b44f736
1 changed files with 7 additions and 8 deletions
|
@ -265,11 +265,13 @@ daemon_check() {
|
||||||
|
|
||||||
testResolver() {
|
testResolver() {
|
||||||
header_write "Resolver Functions Check"
|
header_write "Resolver Functions Check"
|
||||||
|
local protocol="${1}"
|
||||||
|
local IP="${2}"
|
||||||
local url
|
local url
|
||||||
local testurl
|
local testurl
|
||||||
local localdig
|
local localdig
|
||||||
local piholedig
|
local piholedig
|
||||||
|
local remotedig
|
||||||
|
|
||||||
# Find a blocked url that has not been whitelisted.
|
# Find a blocked url that has not been whitelisted.
|
||||||
url=$(shuf -n 1 "${GRAVITYFILE}" | awk -F ' ' '{ print $2 }')
|
url=$(shuf -n 1 "${GRAVITYFILE}" | awk -F ' ' '{ print $2 }')
|
||||||
|
@ -278,8 +280,7 @@ testResolver() {
|
||||||
|
|
||||||
|
|
||||||
log_write "Resolution of ${testurl} from Pi-hole (localhost):"
|
log_write "Resolution of ${testurl} from Pi-hole (localhost):"
|
||||||
|
if localdig=$(dig -"${protocol}" "${testurl}" @localhost +short); then
|
||||||
if localdig=$(dig "${testurl}" @localhost +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"
|
||||||
|
@ -287,8 +288,7 @@ testResolver() {
|
||||||
log_write ""
|
log_write ""
|
||||||
|
|
||||||
log_write "Resolution of ${testurl} from Pi-hole (direct IP):"
|
log_write "Resolution of ${testurl} from Pi-hole (direct IP):"
|
||||||
|
if piholedig=$(dig -"${protocol}" "${testurl}" @"${IP}" +short); then
|
||||||
if piholedig=$(dig "${testurl}" @"${IPV4_ADDRESS%/*}" +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"
|
||||||
|
@ -297,8 +297,7 @@ testResolver() {
|
||||||
|
|
||||||
|
|
||||||
log_write "Resolution of ${testurl} from 8.8.8.8:"
|
log_write "Resolution of ${testurl} from 8.8.8.8:"
|
||||||
remotedig=$(dig "${testurl}" @8.8.8.8 +short)
|
if remotedig=$(dig -"${protocol}" "${testurl}" @8.8.8.8 +short); then
|
||||||
if [[ $? = 0 ]]; then
|
|
||||||
log_write "${remotedig:-NXDOMAIN}"
|
log_write "${remotedig:-NXDOMAIN}"
|
||||||
else
|
else
|
||||||
log_write "Failed to resolve ${testurl} on 8.8.8.8"
|
log_write "Failed to resolve ${testurl} on 8.8.8.8"
|
||||||
|
@ -417,7 +416,7 @@ daemon_check lighttpd http
|
||||||
daemon_check dnsmasq domain
|
daemon_check dnsmasq domain
|
||||||
daemon_check pihole-FTL 4711
|
daemon_check pihole-FTL 4711
|
||||||
checkProcesses
|
checkProcesses
|
||||||
testResolver
|
testResolver 4 "${IPV4_ADDRESS%/*}"
|
||||||
debugLighttpd
|
debugLighttpd
|
||||||
|
|
||||||
files_check "${DNSMASQFILE}"
|
files_check "${DNSMASQFILE}"
|
||||||
|
|
Loading…
Reference in a new issue