Skip to content
Snippets Groups Projects

Improve DNS diagnostics

Merged Petr Špaček requested to merge diagnostics_dns into master
Viewing commit 58c1c3b2
Show latest version
1 file
+ 34
11
Preferences
Compare changes
@@ -4,7 +4,30 @@ help="
gather dns related informations
"
run_prefix () {
echo "Attempting to resolve ${1}"
}
run_dig () {
run_prefix "${1}"
dig @127.0.0.1 +dnssec "${1}"
}
run_nslookup () {
run_prefix "${1}"
nslookup "${1}" 127.0.0.1
}
run () {
# dig has richer output format
which dig &> /dev/null
if [ "$?" -eq 0 ]
then
QTOOL="dig"
else
QTOOL="nslookup"
fi
# resolver config
uci -q show resolver
echo
@@ -23,15 +46,15 @@ run () {
RESOLVER="$(uci get resolver.common.prefered_resolver)"
ps w | grep ${RESOLVER}
# try to resolve some server
nslookup api.turris.cz 127.0.0.1 # should pass
nslookup www.rhybar.cz 127.0.0.1 # should fail
nslookup *.wilda.rhybar.0skar.cz 127.0.0.1 # should fail
nslookup *.wilda.nsec.0skar.cz 127.0.0.1 # should pass
nslookup *.wild.nsec.0skar.cz 127.0.0.1 # should pass
nslookup *.wilda.0skar.cz 127.0.0.1 # should pass
nslookup *.wild.0skar.cz 127.0.0.1 # should pass
nslookup www.wilda.nsec.0skar.cz 127.0.0.1 # should pass
nslookup www.wilda.0skar.cz 127.0.0.1 # should pass
nslookup *.wilda.rhybar.ecdsa.0skar.cz 127.0.0.1 # should fail
echo "== resolution attempts =="
run_${QTOOL} api.turris.cz # should pass
run_${QTOOL} www.rhybar.cz # should fail
run_${QTOOL} *.wilda.rhybar.0skar.cz # should fail
run_${QTOOL} *.wilda.nsec.0skar.cz # should pass
run_${QTOOL} *.wild.nsec.0skar.cz # should pass
run_${QTOOL} *.wilda.0skar.cz # should pass
run_${QTOOL} *.wild.0skar.cz # should pass
run_${QTOOL} www.wilda.nsec.0skar.cz # should pass
run_${QTOOL} www.wilda.0skar.cz # should pass
run_${QTOOL} *.wilda.rhybar.ecdsa.0skar.cz # should fail
}