porkbundomains/porkbun-dynamic-dns-python

Auto IP detection returning IPv6 for A record creation

AEgbert opened this issue · 2 comments

I tried to test this out with a domain I just purchased, and the auto IP detection code returned my IPv6 address. The script then made an A record using that address. From what I understand, an AAAA record would be needed for an IPv6 address, right? (I wasn't able to successfully get to my network with it as-is anyway.)

I'm not sure if it would be better to find a way to force the IP detection code for IPv4 or check for the returned address and choose the record accordingly. (Being able to detect and set both is probably preferable, but I understand if that's out of the intended scope for this script.)

Let me know if there's any other information I can provide that would help.

P.S. Thanks for releasing this script! Looks like it's a pretty new release (and I don't remember coming across it in the Porkbun knowledge base when I first started looking at purchasing a domain name earlier this year), and I'm glad to see an example of how the API can be used. I also just happened across the Java client (which was listed but not linked in the KB article, but is linked in the API reference), and it seems IPv6 handling was addressed in some form there a little over a week ago.

Thanks for this feedback, I'll see what I can do.

I wasn't able to get AAAA support added, but I did alter the default config.json to reflect the fact that we have an IPv4-only hostname you can use instead.

If you open the config.json and change "endpoint" to the following value, it should start detecting the IPv4 address instead:

https://api-ipv4.porkbun.com/api/json/v3

I updated the default config file in the repo to reflect this.