-
-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IPv6 Support #12
Comments
By following this article A zones support ipv4 only. AAAA zones for ipv6. As an idea script probably can detect ipv4 and use A zone upd (current case) and ipv6 use AAAA zone |
Synology doesn't give ipv6 address as an input parameter by default, so it'll have to be via by retrieving ipv6 with file_get_contents('https://api64.ipify.org'). I tried some simulations in the existing code with some quick coding and works fine. However after checking the script itself will need some recoding, in particular now how jsons are being parsed when getting responses from the Cloudflare api and how it's recorded in the hostList array. E.g. now jsons are parsed on array element number 0. But after checking I noticed element 0 sometimes contains A and sometimes AAAA (or both in element 0 and 1 or opposite). not reliable. I am working on it now and'll post it when done. |
Added getting a zone type by ip type: |
There are some serious issues after these modifications. When you have IPV6 it basically only updates the IPV6 and no longer IPV4. It's due how the hostlist array is built and parsed afterwards based on recordsId. Basically every DNS record has a separate RecordId for A and another RecordId for AAAA . I fixed the script where now IPV4 and IPV6 are both recognized. If there's no IPV6, then only IPV4 will be updated. I completely fixed it and over here it works now for both IPV4 and IPV6. Personally I would've done some things completely different (e.g. the way how the hostslist array is constructed, the api calls, etc) and extend it with the supported error messages accepted by DSM. But the one I have will do just fine now, these changes will be for another occasion... |
I have been further thinking on this: A new target-array which contains RecordId keys instead of fullname can simply things. Because fullname can contain 1 or 2 values, a RecordId is always unique after further figuring-out the Cloudflare api. I made a pull request of with my (properly working) changes. Further improvement is in the progress, I'll get back to it... |
What about implement IPv6 support in script?
Regards.
The text was updated successfully, but these errors were encountered: