In my case it’s not “nextcloud” but just “cloud”. As I mentioned above, I had created a second zone for testing with the same subdomain names. There “cloud” was deleted regularly, too, at exactly the same times.
Right now, “cloud” keeps being deleted every 24h at 22:01 CET. Before it was 21:08 CET. The time changed after I deleted some obsolete A and AAAA records. Coincidence?
What does work: Create a bogus A record pointing to your cloud, and a CNAME record “cloud”, “nextcloud” or whatever pointing to that A record.
Other records disappear randomly, too, but quite seldom.
A word about the script above: Instead of downloading the current status and then parsing it with jq, you can use the “host” or “dig” command for each of your records and see if it’s resolved so you need not install jq. In my case “host” was not an option because I have a local DNS server that always resolves my domains. “dig @ns1.dynv6.com” works, though. So the related code snippet looks like:
for HOST in "${RECORDS_A[@]}"
do
URL=$HOST.$ZONE
RES=$(dig @ns1.dynv6.com $URL A | grep -e ^$URL | grep -w A)
if [ "$RES" == "" ]
then
...
Hope this helps a bit!
BTW, I’m looking for an alternative, too.
Cheers, Thomas