Fix zone detection: check for dnssec_status instead of name

The error response also contains 'name' in 'zone_name' field,
causing false positives. Check for 'dnssec_status' which only
exists in valid zone responses.
This commit is contained in:
Kilian Ries
2026-01-22 18:13:51 +01:00
parent 9e584e346d
commit 2e85e6f9bb

View File

@@ -145,7 +145,7 @@ _get_zone() {
fi fi
_debug "Trying: $h" _debug "Trying: $h"
if _opusdns_api GET "/v1/dns/$h" && _contains "$response" '"name"'; then if _opusdns_api GET "/v1/dns/$h" && _contains "$response" '"dnssec_status"'; then
_zone="$h" _zone="$h"
_record_name=$(printf "%s" "$domain" | cut -d . -f 1-"$p") _record_name=$(printf "%s" "$domain" | cut -d . -f 1-"$p")
[ -z "$_record_name" ] && _record_name="@" [ -z "$_record_name" ] && _record_name="@"