fix DNS health check: use system resolver instead of hardcoded 10.0.20.101

The check was querying Technitium DNS directly at 10.0.20.101:53, which
refuses connections from non-cluster hosts. Use the system resolver
(no @server flag) so it works from any host or pod environment.

[ci skip]

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Viktor Barzin 2026-03-12 09:08:34 +00:00
parent 81bfccaefc
commit bef0c073d5

View file

@ -1032,11 +1032,12 @@ check_dns() {
local internal_ok=false external_ok=false detail=""
# Try dig first (available locally), fall back to python3 (pod environment)
# Use system resolver (no @server) so it works from any host or pod
if command -v dig &>/dev/null; then
if dig @10.0.20.101 viktorbarzin.me +short +time=3 +tries=1 &>/dev/null; then
if dig viktorbarzin.me +short +time=3 +tries=1 2>/dev/null | grep -q .; then
internal_ok=true
fi
if dig @10.0.20.101 google.com +short +time=3 +tries=1 &>/dev/null; then
if dig google.com +short +time=3 +tries=1 2>/dev/null | grep -q .; then
external_ok=true
fi
else