Hello!
I’m running into some unexpected behaviour and I wonder if I’m not just doing something wrong here.
Here’s the situation : I have two domains set up both as single zone and correctly delegated that I can both update individually without issue. Those two zones should be identical, having the same records, pointing on the same IPs.
When I run the script updating my-main-domain, all proper records are created/updated.
When I run the script updating my-backup-domain, all proper records are created/updated BUT they are also removed from my-main-domain zone.
If I run the script updating my-main-domain again, all proper records are created/updated BUT they are also removed from my-backup-domain zone.
Do you have any explanation about this behaviour? Do I do something wrong? You’ll find bot update scripts below.
Thanks in advance for your answer.
my-main-domain update script
#!/bin/bash
myip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
nsupdate <<EOF
zone my-main-domain.tk
update delete home.my-main-domain.tk A
update add home.my-main-domain.tk 60 A $myip
update delete proxmox.my-main-domain.tk A
update add proxmox.my-main-domain.tk 60 A $myip
key hmac-sha512:tsig-my-main-domain.dynv6.com my-main-domain-key
send
EOF
my-backup-domain update script
#!/bin/bash
myip="$(dig +short myip.opendns.com @resolver1.opendns.com)"
nsupdate <<EOF
zone my-backup-domain.tk
update delete home.my-backup-domain.tk A
update add home.my-backup-domain.tk 60 A $myip
update delete proxmox.my-backup-domain.tk A
update add proxmox.my-backup-domain.tk 60 A $myip
key hmac-sha512:tsig-my-backup-domain.dynv6.com my-backup-domain-key
send
EOF