自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...) https://ddns.newfuture.cc/

New Future 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
.github 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
.release 7491693174 update realease actions 6 months ago
.vscode 458f354067 fix(http): fix and refactor http (#520) 4 months ago
ddns 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
doc 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
docker 458f354067 fix(http): fix and refactor http (#520) 4 months ago
schema 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
tests 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
.gitignore da19b8c0c4 更新配置文件模式至v4.0 重构日志配置,(#465) 6 months ago
CNAME 884af7500a Create CNAME 7 years ago
LICENSE e8415fd7f9 docs(pypi): update documents for pypi 6 years ago
README.en.md 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
README.md 96b4ca2e0c feat(config): 支持多配置文件和多服务商 优化http support multi config/providers (#531) 4 months ago
_config.yml 505caa31a8 revert theme 4 months ago
favicon.ico 3b7d291bd5 优化ico (#467) 6 months ago
pyproject.toml f1a764d3c2 refact(provider): 巨大重构 (#484) 5 months ago
run.bat cd1444ddb0 调整windows显示,调整task user 9 years ago
run.py 411764e1b5 filter out: bz2,csv (#525) 4 months ago
setup.cfg ecee2bf644 Setup.cfg for py2 (#483) 5 months ago
systemd.sh cb5541718c Fix shebang typo (#217) 5 years ago
task.bat 863c8f0d5c 修复windows下定时任务重定向失败的BUG (#414) 1 year ago
task.sh 4679a78013 #27 7 years ago

README.en.md

DDNS

Automatically update DNS records to the current IP address, supporting IPv4 and IPv6, local (private) IP and public IP. Proxy mode supported, with automatic DNS record creation.

Github Release PyPI Docker Image Version Build Status Publish


Features

⚡ Providers marked with lightning use advanced HMAC-SHA256 signature authentication for enterprise-level security

  • Other Features:
    • Configurable scheduled tasks
    • TTL configuration support
    • DNS line (ISP) configuration support (for domestic providers)
    • Local file caching (reduces API requests)
    • Custom callback API trigger on IP change (mutually exclusive with DDNS functionality)

Usage

① Installation

Choose one of the following methods: binary version, pip version, source code execution, or Docker.

Docker version is recommended for best compatibility, small size, and optimized performance.

  • #### Docker (Requires Docker Installation)

For detailed instructions and advanced usage, see Docker Usage Documentation

Supports command line, configuration file, and environment variable parameters
  • Command line CLI

      docker run newfuture/ddns -h
    
  • Using configuration file (Docker working directory /ddns/, default config location /ddns/config.json):

      docker run -d -v /host/config/:/ddns/ --network host newfuture/ddns
    
  • Using environment variables:

      docker run -d \
        -e DDNS_DNS=dnspod \
        -e DDNS_ID=12345 \
        -e DDNS_TOKEN=mytokenkey \
        -e DDNS_IPV4=ddns.newfuture.cc \
        --network host \
        newfuture/ddns
    

  • pip Installation (Requires pip or easy_install)

    1. Install ddns: pip install ddns or easy_install ddns
    2. Run: ddns -h or python -m ddns
  • Binary Version (Single file, no Python required)

Go to releases to download the corresponding version

  • Source Code Execution (No dependencies, requires Python environment)

    1. Clone or download this repository and extract
    2. Run python run.py or python -m ddns

② Quick Configuration

  1. Apply for API token, fill in the corresponding id and token fields:

  2. Modify the configuration file, ipv4 and ipv6 fields for domains to be updated, refer to configuration instructions for details

Detailed Configuration

All fields can be configured through three methods, with priority: Command Line Parameters > JSON Configuration File > Environment Variables

  1. Command Line Parameters ddns --key=value (use ddns -h for details), highest priority
  2. JSON Configuration File (null values are considered valid and will override environment variable settings; if no corresponding key exists, environment variables will be used)
  3. Environment Variables with DDNS_ prefix plus key in uppercase or lowercase, dots converted to underscores (${ddns_id} or ${DDNS_ID}, ${DDNS_LOG_LEVEL})

Configuration Priority and Field Override Relationship

If the same configuration item is set in multiple places, the following priority rules apply:

  • Command Line Parameters: Highest priority, overrides all other settings
  • JSON Configuration File: Between command line and environment variables, overrides environment variable settings
  • Environment Variables: Lowest priority, used when not set by other methods

Advanced Usage:

  • JSON configuration file can contain only partial fields, missing fields will use environment variables
  • Environment variables support both uppercase and lowercase formats
  • Support for nested configuration through dot notation converted to underscores

Scheduled Tasks

Set up scheduled tasks to run automatically This tool itself does not include loop and scheduled execution functions (to reduce code complexity). You can use system scheduled tasks to run regularly. #### Windows - [Recommended] Run as system identity, right-click "Run as administrator" on `task.bat` (or run in administrator command line) - Run scheduled task as current user, double-click or run `task.bat` (a black window will flash during execution) #### Linux - Using init.d and crontab: ```bash sudo ./task.sh ``` - Using systemd: ```bash Install: sudo ./systemd.sh install Uninstall: sudo ./systemd.sh uninstall ``` Files installed by this script comply with [Filesystem Hierarchy Standard (FHS)](https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard): Executable files are located in `/usr/share/DDNS` Configuration files are located in `/etc/DDNS` #### Docker Docker images, without additional parameters, have a scheduled task enabled by default that runs every 5 minutes

FAQ

Windows Server [SSL: CERTIFICATE_VERIFY_FAILED] > Windows Server default security policy will prohibit any untrusted SSL certificates. You can manually add the corresponding certificates [#56](https://github.com/NewFuture/DDNS/issues/56#issuecomment-487371078) Use the system's built-in IE browser to visit the corresponding API once: - alidns: - aliesa: - cloudflare: - dns.com: - dnspod.cn: - dnspod international: - Huawei DNS:
Troubleshooting and Feedback 1. First confirm whether it's a system/network environment issue 2. Search for similar issues in [issues](https://github.com/NewFuture/DDNS/issues) 3. If neither of the above can solve the problem or you're sure it's a bug, [create a new issue here](https://github.com/NewFuture/DDNS/issues/new) - [ ] Enable `--debug` - [ ] Include these contents: **running version and method**, **system environment**, **error logs**, **configuration file with id/token removed** - [ ] For source code execution, specify the Python environment used

Contributors

License

MIT

Star History

Star History Chart