Coder Social home page Coder Social logo

Comments (5)

mrikirill avatar mrikirill commented on June 6, 2024 2

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

from synologyddnscloudflaremultidomain.

smoetje avatar smoetje commented on June 6, 2024 2

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.

from synologyddnscloudflaremultidomain.

mrikirill avatar mrikirill commented on June 6, 2024 1

Added getting a zone type by ip type:
IPv4 = zone A
IPv6 = zone AAAA
as @smoetje has mentioned I've added getting ip from https://api64.ipify.org instead of if Synology input param

from synologyddnscloudflaremultidomain.

smoetje avatar smoetje commented on June 6, 2024

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...

from synologyddnscloudflaremultidomain.

smoetje avatar smoetje commented on June 6, 2024

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...

from synologyddnscloudflaremultidomain.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.