Skip to content

deltxprt/cloudflare-ddns

Repository files navigation

Cloudflare-DDNS

This is a cloudflare ddns integration.

Usage

Warning

This will only work if you host your dns with cloudflare.

The app will run on an interval that you set or default to 5 minutes. It will check your public ip via the url 'https://cloudflare.com/cdn-cgi/trace' and update the record if it has changed.

Configurations

Cloudflare Token

You will need to create a token with the following permissions:

  • DNS: Edit

Environment Variables

  • CF_TOKEN - Your cloudflare token
  • RECORD_NAME - The record you want to update (foo.bar.example.com)
  • INTERVAL - The interval you want to update the record (5m, 1h, 1d) default: 5m
  • PROXIED - If you want to proxy the record (1 or 0) default: 0

Installation

Linux

quick install

curl -s https://raw.githubusercontent.com/deltxprt/cloudflare-ddns/refs/heads/master/install.sh | bash

quick unistall

curl -s https://raw.githubusercontent.com/deltxprt/cloudflare-ddns/refs/heads/master/uninstall.sh | bash

SystemD Service

see cf-ddns.service

Windows

soon

Container

Podman Adhoc

podman run -d \
    --name=cloudflare-ddns \
    --restart unless-stopped \
    -e CF_TOKEN=your_token \
    -e RECORD_NAME=foo.bar.example.com \
    -e INTERVAL=5m \
    -e PROXIED=1 \
    ghcr.io/deltxprt/cloudflare-ddns:latest

Podman Quadlet

soon

Docker Adhoc

docker run -d \
    --name=cloudflare-ddns \
    --restart unless-stopped \
    -e CF_TOKEN=your_token \
    -e RECORD_NAME=foo.bar.example.com \
    -e INTERVAL=5m \
    -e PROXIED=1 \
    ghcr.io/deltxprt/cloudflare-ddns:latest

Docker Compose

services:
    cloudflare-ddns:
        image: ghcr.io/deltxprt/cloudflare-ddns:latest
        container_name: cloudflare-ddns
        restart: unless-stopped
        environment:
          - CF_TOKEN=your_token
          - RECORD_NAME=foo.bar.example.com
          - INTERVAL=5m
          - PROXIED=1

Troubleshooting

Logs

You can view the logs by running journalctl -u cloudflare-ddns

Issues

If you have any issues, please open an issue on the github repo.

Contributing

I'm open to suggestions and contributions. Feel free to open a PR or issue!

About

simple cloudflare ddns integration

Resources

Stars

Watchers

Forks

Packages