# Find/isolate the root zone to work with in createRecord() and deleteRecord()
rootZone=""
if["$checkMultiZones"="true"];then
rootZone=$(for zone in$(echo"$result" | tr-d'\n'' ');do
if["$(echo"$domain" | grep"$zone")"!=""];then
_debug2 _get_root "- trying to figure out if $zone is in $domain"
echo"$zone"
break
fi
done)
#rootZone=$(for x in $(printf "%s" "${result3}" | tr ',' '\n' | sed -n 's/.*"name":"\(.*\)",.*/\1/p'); do if [ "$(echo "$domain" | grep "$x")" != "" ]; then echo "$x"; fi; done)
rootZone=$(for x in$(printf"%s\n""${result3}" | tr',''\n' | grep name | cut-d'"'-f4);do if["$(echo"$domain" | grep"$x")"!=""];then echo"$x";fi;done)
if["$rootZone"!=""];then
_debug2 _rootZone "- root zone for $domain is $rootZone"
else
_err "Could not find root zone for $domain, is it correctly typed?"