Zone and records not working

created a zone and put 3 A records in there.

I have 3 server reboot every night , once rebooted I’m not able to access any server through a record or as per zone file. like A record= bb.myzone.army

I’m using ddclient which auto run on one server that I start at first .

so I need to update A record everyday in dynV6 web interface ?

I can not understand the problem.

dynv6 offers 6 domains:

dns.army, dns.navy, dynv6.net, v6.army, v6.navy, v6.rocks

So bb.myzone.army is not possible.

And how should 3 servers be accessible under the same ipv4 address?

If you enter it in the web interface, does everything work?

Pls read A record= bb.myzone.army as A record= bb.dns.army only,

Yes when I update in web interface all records work perfectly , but when I reboot my server , server gets new ip and and doesn’t work after that

OK.

Normally your router gets the public ipv4 address, why does your server get it?

I have servers at google cloud and each has dynamic public ip

OK.

This is not exactly a common case. I think each of the servers has its own ipv4 and ipv6 address. I don’t think that can be solved with a DNS client for only one domain. I see 2 possibilities.

You create a dynamic domain for each server, e.g. bb.dns.army, cc.dns.army, dd.dns.army, and update the addresses per server with a separate DNS client.

You create a dynamic domain for one server, e.g. bb.dns.army, and a subdomain for each of the others, e.g. one.bb.dns.army, two.bb.dns.army, … Then you have to update the addresses of the servers with the subdomains via REST API or nsupdate. I recommend simply updating all of them with nsupdate, then you can do without the DNS client.

Example:

nsupdate <<EOF
  server ns1.dynv6.com
  zone bb.dns.army
  update delete bb.dns.army A
  update add bb.dns.army 60 A 127.0.0.1
  update delete bb.dns.army AAAA
  update add bb.dns.army 60 AAAA ::1
  update delete one.bb.dns.army A
  update add one.bb.dns.army 60 A 127.0.0.1
  update delete one.bb.dns.army AAAA
  update add one.bb.dns.army 60 AAAA ::1
  update two.delete bb.dns.army A
  update add two.bb.dns.army 60 A 127.0.0.1
  update delete two.bb.dns.army AAAA
  update add two.bb.dns.army 60 AAAA ::1
  [... more servers]
  key hmac-sha256:tsig-123.dynv6.com YourSHAREDsecret==
  send
EOF

(127.0.0.1 and ::1 of course means the respective current addresses)

edit:
Or each server just updates its address.

nsupdate <<EOF
  server ns1.dynv6.com
  zone bb.dns.army
  update delete bb.dns.army A
  update add bb.dns.army 60 A 127.0.0.1
  update delete bb.dns.army AAAA
  update add bb.dns.army 60 AAAA ::1
  key hmac-sha256:tsig-123.dynv6.com YourSHAREDsecret==
  send
EOF

nsupdate <<EOF
  server ns1.dynv6.com
  zone bb.dns.army
  update delete one.bb.dns.army A
  update add one.bb.dns.army 60 A 127.0.0.1
  update delete one.bb.dns.army AAAA
  update add one.bb.dns.army 60 AAAA ::1
  key hmac-sha256:tsig-123.dynv6.com YourSHAREDsecret==
  send
EOF

nsupdate <<EOF
  server ns1.dynv6.com
  zone bb.dns.army
  update two.delete bb.dns.army A
  update add two.bb.dns.army 60 A 127.0.0.1
  update delete two.bb.dns.army AAAA
  update add two.bb.dns.army 60 AAAA ::1
  key hmac-sha256:tsig-123.dynv6.com YourSHAREDsecret==
  send
EOF

First solution looks good to me , need testing, can I skip AAAA entries here ?

If you don’t need AAAA entries, you can omit them. But then there should really be no (old) AAAA records, otherwise there will be incorrect ipv6 addresses in the DNS resolution. You can delete them in the web interface.

Please note the error in the original post. It should be right:

nsupdate <<EOF
server ns1.dynv6.com
zone bb.dns.army
update delete bb.dns.army A
update add bb.dns.army 60 A 127.0.0.1
update delete one.bb.dns.army A
update add one.bb.dns.army 60 A 127.0.0.1
update delete two.bb.dns.army A
update add two.bb.dns.army 60 A 127.0.0.1
[… more servers]
key hmac-sha256:tsig-123.dynv6.com YourSHAREDsecret==
send
EOF

Replace 127.0.0.1 with the respective current ipv4 address!

So I need to manually run this command everyday, or after every start/stop server ?

Every time the ip address has changed. Since your servers get a new address with every restart, preferably after every restart. And you could also automate it with a script.