Skip to content
Snippets Groups Projects

Improve DNS diagnostics

Merged Petr Špaček requested to merge diagnostics_dns into master
Viewing commit d170e6ff
Show latest version
1 file
+ 11
0
Preferences
Compare changes
@@ -18,6 +18,11 @@ run_nslookup () {
nslookup "${1}" 127.0.0.1
}
run_kresd_command () {
KRESD_TTY="$(uci get resolver.kresd.rundir)/tty/$(pidof kresd)"
echo "${1}" | socat - "unix-connect:${KRESD_TTY}"
}
run () {
# dig has richer output format
which dig &> /dev/null
@@ -46,6 +51,12 @@ run () {
RESOLVER="$(uci get resolver.common.prefered_resolver)"
ps w | grep ${RESOLVER}
if [ "${RESOLVER}" == "kresd" ]
then
echo "== enable verbose logging (reboot to disable it) =="
run_kresd_command "verbose(true)"
fi
echo "== resolution attempts =="
run_${QTOOL} api.turris.cz # should pass
run_${QTOOL} www.rhybar.cz # should fail