Skip to content

psi29a/rddclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rddclient - Rust Dynamic DNS Client

A fast, lightweight Dynamic DNS updater written in Rust that supports multiple DNS providers.

Supported Providers

  • 1984.is - DynDNS2-compatible protocol
  • Afraid.org - Token-based update API (v2)
  • Cloudflare - Full API support with zone management
  • ChangeIP - Legacy JSON protocol with basic auth
  • ClouDNS - Simple dynurl-based updates
  • DDNS.FM - DDNS service with REST API
  • DDNSS - Simple token-based GET protocol
  • deSEC - German DNS with token auth (DynDNS2-compatible)
  • DigitalOcean - REST API with token authentication
  • Dinahosting - REST API with basic auth
  • Directnic - Pre-configured URL updates
  • DNS Made Easy - Dynamic DNS endpoint
  • DNSExit2 - JSON API v2 with API key
  • DNSPod - Chinese DNS with token-based API
  • Domeneshop - REST API with basic auth
  • DonDominio - JSON API with key auth
  • DSLReports - DSLReports legacy protocol
  • DuckDNS - Simple token-based updates
  • DynDNS v1 - Legacy DynDNS protocol (pre-DynDNS2)
  • DynDNS2 - Compatible with DynDNS, DNSdynamic, and other DynDNS2-compatible services
  • Dynu - DynDNS2-compatible protocol
  • EasyDNS - REST API with basic auth (10min update interval)
  • Email Only - Send notifications via email instead of updating DNS (requires system sendmail)
  • Enom - Dynamic DNS API
  • Freedns (afraid.org) - Hash-based update protocol
  • Freemyip - Simple token-based updates
  • Gandi - REST API with API key
  • GoDaddy - REST API with key/secret
  • Google Domains - DynDNS2-compatible protocol
  • Hetzner - REST API with API token
  • Hurricane Electric (HE.net) - Simple update protocol
  • Infomaniak - DynDNS2-compatible protocol
  • INWX - DynDNS2-compatible protocol
  • Key-Systems (RRPproxy) - Token-based updates
  • Linode - Linode API v4 with token auth
  • Loopia - DynDNS2-compatible protocol
  • LuaDNS - REST API with email/token auth
  • Mythic Beasts - Modern dual-endpoint API
  • Namecheap - Native Dynamic DNS support
  • NFSN (NearlyFreeSpeech.NET) - Basic auth updates
  • Njalla - Simple API with password auth
  • No-IP - DynDNS2-compatible with No-IP specifics
  • nsupdate - RFC 2136 Dynamic DNS Update protocol (requires DNS library)
  • OVH - REST API (simplified, requires proper signing for production)
  • Porkbun - REST API with key/secret
  • Regfish - DynDNS2-compatible protocol
  • Selfhost.de - German provider with DynDNS2 protocol
  • Sitelutions - DynDNS2-compatible protocol
  • Woima.fi - Finnish DNS with DynDNS2 protocol
  • Yandex - Yandex PDD API
  • Zoneedit - DynDNS2-compatible protocol
  • ZoneEdit v1 - ZoneEdit legacy protocol

DynDNS2-Compatible Providers

The dyndns2 provider also works with many other services that support the DynDNS2 protocol, including but not limited to: DNSdynamic, DuckDNS (alternative), many router DDNS services, and custom DDNS implementations.

Features

  • 🚀 Blazingly fast - Compiled Rust vs interpreted Perl
  • 📦 Super tiny - Single < 1MB self-contained binary vs ddclient's ~64MB+ (Perl runtime + core libraries + modules)
  • 🎯 Drop-in replacement - Compatible with ddclient config format and workflows
  • 🌍 Full IPv6 support - All providers support both A and AAAA records
  • 📝 Flexible configuration - ddclient-compatible config files or command-line arguments
  • 🔄 Smart IP detection - Web services, network interfaces, custom commands, or manual IP
  • 💾 State management - Tracks IP changes to minimize unnecessary DNS updates
  • ⚙️ Easily extensible - Clean architecture for adding new providers

Installation

From Source

cargo build --release
sudo cp target/release/rddclient /usr/local/bin/

System Integration

See the examples/ directory for:

  • Systemd service and timer units
  • Cron job examples
  • Network hook scripts (DHCP, NetworkManager, PPP)
  • Provider-specific configurations

Quick Start

Simple Example

# Cloudflare with API token
rddclient --protocol cloudflare \
  --zone example.com \
  --login token \
  --password YOUR_API_TOKEN \
  --host ddns.example.com

# Or use a config file (recommended)
rddclient --file /etc/rddclient/rddclient.conf

Configuration File Example

# /etc/rddclient/rddclient.conf
protocol = cloudflare
zone = example.com
login = token
password = your_api_token_here
host = ddns.example.com

For more examples, see:

Advanced IP Detection

# Use specific network interface
rddclient --file myconfig.conf --use-method if --if-name eth0

# Use custom command (always use HTTPS for security)
rddclient --file myconfig.conf --use-method cmd --cmd 'curl -s https://ifconfig.me'

# Use custom web service
rddclient --file myconfig.conf --use-method web --web https://api64.ipify.org

# Manual IP specification
rddclient --file myconfig.conf --ip 203.0.113.42

Rate Limiting

# Customize update intervals (default: min=30s, max=25d, error=5m)
rddclient --file myconfig.conf --min-interval 5m --max-interval 30d

# Prevent rapid retries after errors
rddclient --file myconfig.conf --min-error-interval 10m

# Force update regardless of intervals
rddclient --file myconfig.conf --force

Interval formats: 30s (seconds), 5m (minutes), 2h (hours), 25d (days)

Documentation

Provider-Specific Notes

Cloudflare

  • Requires Zone ID (found in domain Overview)
  • API token needs DNS:Edit permissions

DigitalOcean

  • Personal Access Token required
  • DNS record must already exist

DuckDNS

  • Free service, no account needed for basic use
  • Token is per-account, works for all your domains
  • Hostname should be without .duckdns.org suffix

Freedns (afraid.org)

  • Uses unique update token per hostname
  • Token is different for each DNS record

GoDaddy

  • Requires API key/secret from developer.godaddy.com
  • Production keys require domain ownership verification

Hurricane Electric

  • Free DNS hosting
  • Update key is per-hostname (found in DNS management)

OVH

  • Current implementation is simplified
  • Full production use requires proper API request signing
  • Requires application key, secret, and consumer key

Porkbun

  • Requires API enabled in account settings
  • Both API key and secret key needed

Architecture

rddclient uses a modular architecture with provider-specific clients implementing a common DnsClient trait:

src/
├── main.rs              # Application entry point & orchestration
├── args.rs              # CLI argument parsing (Clap)
├── config.rs            # ddclient config file parser
├── ip.rs                # IP detection with fallback sources
└── clients/             # DNS provider implementations
    ├── mod.rs           # DnsClient trait & provider factory
    ├── cloudflare.rs    # Cloudflare API client
    ├── digitalocean.rs  # DigitalOcean API client
    ├── duckdns.rs       # DuckDNS API client
    ├── dyndns2.rs       # DynDNS2 protocol (40+ providers)
    └── ...              # 52 total providers

Adding New Providers

To add a new DNS provider, see docs/ProviderGuidelines.md for detailed instructions.

Quick overview:

  1. Create src/clients/newprovider.rs implementing the DnsClient trait
  2. Add module to src/clients/mod.rs
  3. Add to create_client() factory function
  4. Add example configuration to examples/
  5. Add tests

Example template:

use crate::clients::DnsClient;
use std::error::Error;
use std::net::IpAddr;

pub struct NewProviderClient {
    api_key: String,
    // provider-specific fields
}

impl DnsClient for NewProviderClient {
    fn update_record(&self, hostname: &str, ip: IpAddr) -> Result<(), Box<dyn Error>> {
        // Make API call to update DNS record
        Ok(())
    }
}

Troubleshooting

IP Detection Issues

Automatic IP detection tries multiple sources with fallback. If all fail, specify manually with --ip.

Authentication Errors

  • Verify API credentials in configuration
  • Check token/key permissions
  • Look for trailing spaces in config values

DNS Update Failures

  • Some providers require pre-creating DNS records
  • Verify domain ownership in provider dashboard
  • Use --verbose for detailed request/response logs

For more help, see docs/troubleshooting.md.

License

GPLv3

Contributing

Contributions welcome! See docs/ProviderGuidelines.md for comprehensive guidelines on adding new providers.

Roadmap

See docs/parity.md for complete feature parity tracking with ddclient.

Completed:

  • ✅ Full IPv6 support (all providers)
  • --force flag for forced updates
  • ✅ ddclient config file compatibility
  • ✅ State management & IP change detection (v0.6.0)
  • --cache file support for persistent state
  • ✅ Advanced IP detection (v0.6.0): --use-method, --if-name, --cmd, --web
  • ✅ Rate limiting (v0.6.0): --min-interval, --max-interval, --min-error-interval

In Progress:

  • Daemon mode with --daemon flag

Planned:

  • Email notifications
  • Proxy support

About

small, fast rust based dynamic dns updator

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

No packages published

Contributors 2

  •  
  •  

Languages