'Using the Google Domains Dynamic DNS API, How Can I Create Both A and AAAA Records (IPv4 and IPv6)?

Google Domains exposes an API to change Dynamic DNS synthetic records. By sending a POST (or GET) request to a specific URL with the scheme https://username:[email protected]/nic/update?hostname=subdomain.yourdomain.com&myip=1.2.3.4, Google will theoretically add an A record or AAAA record with the specified IP address... but not both at the same time.

I seem to be unable to create both an A record (for IPv4 traffic) and an AAAA record (for IPv6 traffic); I just switch from one to the other, like so:

roger@computer:~$ curl -6 -X POST -d "hostname=<subdomain>&myip=<ipv4 address>"  https://<username>:<password>@domains.google.com/nic/update
good <ipv4 address>
roger@computer:~$ curl -6 -X POST -d "hostname=<subdomain>&myip=<ipv6 address>"  https://<username>:<password>@domains.google.com/nic/update 
good <ipv6 address>
roger@computer:~$ curl -4 -X POST -d "hostname=<subdomain>&myip=<ipv6 address>"  https://<username>:<password>@domains.google.com/nic/update 
nochg <ipv6 address>
roger@computer:~$ curl -4 -X POST -d "hostname=<subdomain>&myip=<ipv4 address>"  https://<username>:<password>@domains.google.com/nic/update
good <ipv4 address>

After all these, the record that remains is an A record for my IPv4 address, with no AAAA record.

Is there a way to create both records for a dual-stack machine?



Solution 1:[1]

Doesn't seem you can. Not documented but whichever of A or AAAA (or the latest of one of the other) is posted will be recorded. Once one exists however, you can create a standard record for the other though that will of course not be dynamic. You cannot create a standard record until a dynamic record has actually be set.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Matt Povey