Skip to content

psi29a/rddclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

66 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