linode_api4-python icon indicating copy to clipboard operation
linode_api4-python copied to clipboard

[Feature]: documentation: DDNS example

Open SpareSimian opened this issue 10 months ago • 2 comments

Description

I'd like my Linodes and my home system to automatically update their A and AAAA records in my domain when rebooted or receiving a new address via DHCP. An example script to do that would be most helpful. Perhaps added after the other examples in the README. An example with "[remote_addr]" would be ideal, but it's not clear how to get the library to choose between IPv4 and IPv6 to update the A vs AAAA record.

SpareSimian avatar Feb 05 '25 19:02 SpareSimian

Some info on forcing IPv4/IPv6 in requests: https://github.com/psf/requests/issues/1691 https://stackoverflow.com/questions/33046733/force-requests-to-use-ipv4-ipv6

Given how complicated that is, it does seem easier to find one's own address first using a website that only responds to IPv4 or IPv6 but not both and then use the address discovered in the Linode v4 API. Perhaps the API server can provide two URLs just for that purpose, one on each transport.

SpareSimian avatar Feb 06 '25 05:02 SpareSimian

With the above clues I was able to produce this. I suggest adding it to the examples.

https://github.com/SpareSimian/LinodeDDNS

SpareSimian avatar Feb 07 '25 17:02 SpareSimian