Skip to content

Cloudflare DNS as DynDNS Provider #7

Description

@EV21

It seems pretty easy

We need

  • Zone-ID or the Zone-Domain
    You can find it somewhere at Dashboard > Website > example.com
    In theory we can automatically get that with
    curl -X GET "https://api.cloudflare.com/client/v4/zones?name=example.com
    but that does not work with a subdomain
    curl -X GET "https://api.cloudflare.com/client/v4/zones?name=dyndns.example.com
    Cloudflare does not allow to have Subdomain-Zones so we also need the Zone-ID or Zone-Domain (simpler) as an additional parameter if there is no easy way of doing a workaround like we have it with the DomRobot API from INWX.
  • API-Token
    Permissions: Zone.DNS edit
    Zone Resources: at least the specific zone for example.com
  • Domain
    This is only needed if it is a subdomain like dyndns.example.com and it is not identical to the Zone-Domain

With this information we can automatically get the Domain-Record-ID from the API and finally update the record

requests:

  • GET "https://api.cloudflare.com/client/v4/zones?name=example.com"
  • GET "https://api.cloudflare.com/client/v4/zones/<zone-id>/dns_records?name=dyndns.example.com"
  • PUT "https://api.cloudflare.com/client/v4/zones/<zone-id>/dns_records/<domain-record-id>"
    with data: {"type":"A","name":"dyndns.example.com","content":"127.0.0.1","ttl":60}
    in case someone wants to use the cloudflare network we also need to set "proxied":true (default is false)

This feature may require some renaming (refactoring) for the INWX Domrobot part to keep the code clean and manageable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions