All Projects → qdm12 → Ddns Updater

qdm12 / Ddns Updater

Licence: mit
Container to update DNS records periodically with WebUI for many DNS providers

Programming Languages

go
31211 projects - #10 most used programming language
golang
3204 projects

Projects that are alternatives of or similar to Ddns Updater

Ddns
🚩 自动更新域名解析到本机IP(支持dnspod,阿里DNS,CloudFlare,华为云,DNSCOM...)
Stars: ✭ 2,582 (+1095.37%)
Mutual labels:  cloudflare
Awesome Cloudflare
⛅️ Curated list of awesome Cloudflare worker recipes, open-source projects, guides, blogs and other resources.
Stars: ✭ 186 (-13.89%)
Mutual labels:  cloudflare
Cloudflare Scrape
A Python module to bypass Cloudflare's anti-bot page.
Stars: ✭ 2,606 (+1106.48%)
Mutual labels:  cloudflare
Isbgpsafeyet.com
Is BGP safe yet?
Stars: ✭ 163 (-24.54%)
Mutual labels:  cloudflare
Alpine Sqs
Dockerized ElasticMQ server + web UI over Alpine Linux for local development
Stars: ✭ 183 (-15.28%)
Mutual labels:  webui
Auproximity
AUProximity is an open source proximity voice chat platform, primarily aimed at Among Us.
Stars: ✭ 194 (-10.19%)
Mutual labels:  webui
Flares
Flares 🔥 is a CloudFlare DNS backup tool
Stars: ✭ 156 (-27.78%)
Mutual labels:  cloudflare
Cloudmare
Cloudflare, Sucuri, Incapsula real IP tracker.
Stars: ✭ 213 (-1.39%)
Mutual labels:  cloudflare
Pyload
The free and open-source Download Manager written in pure Python
Stars: ✭ 2,393 (+1007.87%)
Mutual labels:  webui
Webloyer
Webloyer is a web UI for managing Deployer deployments
Stars: ✭ 199 (-7.87%)
Mutual labels:  webui
Cloudflare Cors Anywhere
CORS "anywhere" proxy in a Cloudflare worker. DEMO at: https://test.cors.workers.dev/
Stars: ✭ 162 (-25%)
Mutual labels:  cloudflare
Promansible
PromAnsible, 集成了Prometheuse(基于时间序列数据的服务监控系统)和Ansible(超级简单好用的IT自动化系统),并通过事件报警机制把二者紧密的结合在一起,并配以简单易用的WebUI,真正实现了监控-报警-处理一条龙的全自动化服务。
Stars: ✭ 183 (-15.28%)
Mutual labels:  webui
Cfpmp
Cloudflare Partner Management Panel
Stars: ✭ 194 (-10.19%)
Mutual labels:  cloudflare
Sites Using Cloudflare
💔 Archived list of domains using Cloudflare DNS at the time of the CloudBleed announcement.
Stars: ✭ 1,914 (+786.11%)
Mutual labels:  cloudflare
Terraform Provider Cloudflare
Cloudflare Terraform Provider
Stars: ✭ 208 (-3.7%)
Mutual labels:  cloudflare
Firewall
ASP.NET Core middleware for IP address filtering.
Stars: ✭ 159 (-26.39%)
Mutual labels:  cloudflare
Cloudflare
CloudFlare API - PHP
Stars: ✭ 192 (-11.11%)
Mutual labels:  cloudflare
Gortr
The RPKI-to-Router server used at Cloudflare
Stars: ✭ 216 (+0%)
Mutual labels:  cloudflare
Google Drive Index
Index Google Drive Files Easily and Free
Stars: ✭ 205 (-5.09%)
Mutual labels:  cloudflare
Yaaw
Yet Another Aria2 Webui in pure HTML/CSS/Javascirpt
Stars: ✭ 2,288 (+959.26%)
Mutual labels:  webui

Lightweight universal DDNS Updater with Docker and web UI

Light container updating DNS A and/or AAAA records periodically for multiple DNS providers

DDNS Updater logo

Build status Docker Pulls Docker Stars Image size Image version

Join Slack channel GitHub last commit GitHub commit activity GitHub issues

Features

  • Updates periodically A records for different DNS providers:
    • Cloudflare
    • DDNSS.de
    • DigitalOcean
    • DonDominio
    • DNSOMatic
    • DNSPod
    • Dreamhost
    • DuckDNS
    • DynDNS
    • FreeDNS
    • Gandi
    • GoDaddy
    • Google
    • He.net
    • Infomaniak
    • Linode
    • LuaDNS
    • Namecheap
    • NoIP
    • OpenDNS
    • OVH
    • Selfhost.de
    • Strato.de
    • Want more? Create an issue for it!
  • Web User interface

Web UI

  • 14MB Docker image based on a Go static binary in a Scratch Docker image with ca-certificates and timezone data
  • Persistence with a JSON file updates.json to store old IP addresses with change times for each record
  • Docker healthcheck verifying the DNS resolution of your domains
  • Highly configurable
  • Sends notifications to your Android phone, see the Gotify section (it's free, open source and self hosted 🆒)
  • Compatible with amd64, 386, arm64, arm32v7 (Raspberry Pis) CPU architectures.

Setup

The program reads the configuration from a JSON object, either from a file or from an environment variable.

  1. Create a directory of your choice, say data with a file named config.json inside:

    mkdir data
    touch data/config.json
    # Owned by user ID of Docker container (1000)
    chown -R 1000 data
    # all access (for creating json database file data/updates.json)
    chmod 700 data
    # read access only
    chmod 400 data/config.json
    

    (You could change the user ID, for example with 1001, by running the container with --user=1001)

  2. Write a JSON configuration in data/config.json, for example:

    {
        "settings": [
            {
                "provider": "namecheap",
                "domain": "example.com",
                "host": "@",
                "password": "e5322165c1d74692bfa6d807100c0310"
            }
        ]
    }
    

    You can find more information in the configuration section to customize it.

  3. Run the container with

    docker run -d -p 8000:8000/tcp -v "$(pwd)"/data:/updater/data qmcgaw/ddns-updater
    
  4. (Optional) You can also set your JSON configuration as a single environment variable line (i.e. {"settings": [{"provider": "namecheap", ...}]}), which takes precedence over config.json. Note however that if you don't bind mount the /updater/data directory, there won't be a persistent database file /updater/updates.json but it will still work.

Next steps

You can also use docker-compose.yml with:

docker-compose up -d

You can update the image with docker pull qmcgaw/ddns-updater. Other Docker image tags are available.

Configuration

Start by having the following content in config.json, or in your CONFIG environment variable:

{
    "settings": [
        {
            "provider": "",
        },
        {
            "provider": "",
        }
    ]
}

For each setting, you need to fill in parameters. Check the documentation for your DNS provider:

Note that:

  • you can specify multiple hosts for the same domain using a comma separated list. For example with "host": "@,subdomain1,subdomain2",.

Environment variables

Environment variable Default Description
CONFIG One line JSON object containing the entire config (takes precendence over config.json file) if specified
PERIOD 5m Default period of IP address check, following this format
IP_METHOD cycle Method to obtain the public IP address (ipv4 or ipv6). See the IP Methods section
IPV4_METHOD cycle Method to obtain the public IPv4 address only. See the IP Methods section
IPV6_METHOD cycle Method to obtain the public IPv6 address only. See the IP Methods section
UPDATE_COOLDOWN_PERIOD 5m Duration to cooldown between updates for each record. This is useful to avoid being rate limited or banned.
HTTP_TIMEOUT 10s Timeout for all HTTP requests
LISTENING_PORT 8000 Internal TCP listening port for the web UI
ROOT_URL / URL path to append to all paths to the webUI (i.e. /ddns for accessing https://example.com/ddns through a proxy)
BACKUP_PERIOD 0 Set to a period (i.e. 72h15m) to enable zip backups of data/config.json and data/updates.json in a zip file
BACKUP_DIRECTORY /updater/data Directory to write backup zip files to if BACKUP_PERIOD is not 0.
LOG_LEVEL info Level of logging, info, warning or error
LOG_CALLER hidden Show caller per log line, hidden or short
GOTIFY_URL (optional) HTTP(s) URL to your Gotify server
GOTIFY_TOKEN (optional) Token to access your Gotify server
TZ Timezone to have accurate times, i.e. America/Montreal

IP methods

By default, all ip methods are cycled through between all ip methods available for the specified ip version, if any. This allows you not to be blocked for making too many requests. You can otherwise pick one of the following.

You can also specify an HTTPS URL to obtain your public IP address (i.e. -e IPV6_METHOD=https://ipinfo.io/ip)

Host firewall

If you have a host firewall in place, this container needs the following ports:

  • TCP 443 outbound for outbound HTTPS
  • TCP 80 outbound if you use a local unsecured HTTP connection to your Gotify server
  • UDP 53 outbound for outbound DNS resolution
  • TCP 8000 inbound (or other) for the WebUI

Architecture

At program start and every period (5 minutes by default):

  1. Fetch your public IP address
  2. For each record:
    1. DNS resolve it to obtain its current IP address(es)
      • If the resolution fails, update the record with your public IP address by calling the DNS provider API and finish
    2. Check if your public IP address is within the resolved IP addresses
      • Yes: skip the update
      • No: update the record with your public IP address by calling the DNS provider API

💡 We do DNS resolution every period so it detects a change made to the record manually, for example on the DNS provider web UI 💡 As DNS resolutions are essentially free and without rate limiting, these are great to avoid getting banned for too many requests.

Special case: Cloudflare

For Cloudflare records with the proxied option, the following is done.

At program start and every period (5 minutes by default), for each record:

  1. Fetch your public IP address
  2. For each record:
    1. Check the last IP address (persisted in updates.json) for that record
      • If it doesn't exist, update the record with your public IP address by calling the DNS provider API and finish
    2. Check if your public IP address matches the last IP address you updated the record with
      • Yes: skip the update
      • No: update the record with your public IP address by calling the DNS provider API

This is the only way as doing a DNS resolution on the record will give the IP address of a Cloudflare server instead of your server.

⚠️ This has the disadvantage that if the record is changed manually, the program will not detect it. We could do an API call to get the record IP address every period, but that would get you banned especially with a low period duration.

Gotify

Gotify

Gotify is a simple server for sending and receiving messages, and it is free, private and open source

  • It has an Android app to receive notifications
  • The app does not drain your battery 👍
  • The notification server is self hosted, see how to set it up with Docker
  • The notifications only go through your own server (ideally through HTTPS though)

To set it up with DDNS updater:

  1. Go to the Web GUI of Gotify
  2. Login with the admin credentials
  3. Create an app and copy the generated token to the environment variable GOTIFYTOKEN (for this container)
  4. Set the GOTIFYURL variable to the URL of your Gotify server address (i.e. http://127.0.0.1:8080 or https://bla.com/gotify)

Testing

  • The automated healthcheck verifies all your records are up to date using DNS lookups
  • You can also manually check, by:
    1. Going to your DNS management webpage
    2. Setting your record to 127.0.0.1
    3. Run the container
    4. Refresh the DNS management webpage and verify the update happened

Development and contributing

License

This repository is under an MIT license

Used in external projects

Support

Sponsor me on Github or donate to paypal.me/qmcgaw

https://github.com/sponsors/qdm12 https://www.paypal.me/qmcgaw

Many thanks to J. Famiglietti for supporting me financially 🥇👍

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].