Coder Social home page Coder Social logo

cloudflare-ddns's Introduction

Cloudflare DDNS updater

Docker Pulls License

Github Starts Github Fork Github Release

A lightweight script to dynamically update DNS records using cloudflare API. It is packaged as docker container based on alpine image, built for linux/amd64, linux/arm64 and linux/arm/v7 architectures.

Note: Archiving this repo in favour of hotio's cloudflareddns. Please check that project for more information.

Instalation

The image can be pulled from both DockerHub and ghcr.io container registries.

For simplicity and to be k8s CronJob friendly, it does not include any scheduling. The container will start, run the script and exit.

# You can also specify a version as the tag, such as afonsoc12/cloudflare-ddns:2022.10.17
docker pull afonsoc12/cloudflare-ddns:latest

# Run container once
docker run --rm \
    --name cloudflare-ddns \
    -e CLOUDFLARE_API_TOKEN=<API TOKEN> \
    -e CLOUDFLARE_ZONE_ID=<ZONE ID> \
    -e CLOUDFLARE_RECORD_NAME=ip.mydomain.xyz \
    -e TTL=1 `# optional` \
    -e PROXY=false `# optional` \
    afonsoc12/cloudflare-ddns

Cloudflare API credentials

You'll need to create a new API Token from this page. Please select the options below:

  • Permissions:

    • Zone - Zone - Read
    • Zone - DNS - Edit
  • Zone Resources:

    • Include - Specific zone - mydomain.xyz

      OR

    • Include - All zones

Additionally, the cloudflare Zone ID is also needed. It can be gathered from the "Overview" tab. You'll find it on the right panel of the page.

Environment Variables

Variable Function
CLOUDFLARE_API_TOKEN Cloudflare API Token. Must have permission Zone - Zone - Read and Zone - DNS - Edit. Zone Resources can be Include - Specific zone - mydomain.xyz.
CLOUDFLARE_ZONE_ID Cloudflare Zone ID. Can be found in the "Overview" tab of your domain.
CLOUDFLARE_RECORD_NAME Cloudflare record to be updated with new IP.
TTL Set the DNS TTL (seconds).
PROXY Enable cloudflare proxy (true or false).

Credits

Copyright 2022 Afonso Costa

Licensed under the Apache License, Version 2.0 (the "License")

cloudflare-ddns's People

Contributors

afonsoc12 avatar

Watchers

 avatar

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.