ddns-updater

repository·master·Indexed 25 days ago

https://github.com/qdm12/ddns-updater

A lightweight, universal Dynamic DNS (DDNS) updater that keeps DNS A and AAAA records updated for a wide variety of DNS providers. It supports multiple providers simultaneously, provides a web user interface, and can be deployed as a binary, via Docker, or on Kubernetes.

Tokens
25.7K
Snippets
65
Records
144
Agent score
81%

What's inside ddns-updater

  1. Understand the DDNS Update Logic

    master

    The program follows this workflow every period (default 5 minutes):

    1. Fetch Public IP: Obtains the current public IP address.
    2. Resolve Record: Performs a DNS lookup for each configured domain to find its current IP.
    3. Compare & Update:
      • If DNS resolution fails: Update the record with the fetched public IP.
      • If the public IP is NOT in the resolved addresses: Update the record with the public IP.
      • If the public IP matches the resolved address: Skip the update.

    Special Case: Cloudflare Proxied Records For Cloudflare records with proxied: true, DNS resolution returns a Cloudflare server IP instead of your actual IP. In this case, the program compares the fetched public IP against the last known IP stored in updates.json instead of performing a DNS lookup.

  2. Set up Linode domain access

    master

    Before using the Linode provider, you must prepare your Linode account:

    1. Create a personal access token via the Linode dashboard.
    2. Ensure the token has domains set with both read and write privileges.
    3. It is recommended to use a token that does not expire.

    Note: The ddns-updater program will automatically create the A or AAAA record for you if it does not already exist.

  3. Set up Namecheap Dynamic DNS

    master

    Follow these steps to enable Dynamic DNS on your Namecheap domain:

    1. Log in to your Namecheap account.
    2. Navigate to the Advanced DNS settings for your domain using this URL pattern: https://ap.www.namecheap.com/Domains/DomainControlPanel/[YOUR_DOMAIN]/advancedns
    3. In the HOST RECORDS section, click ADD NEW RECORD.
    4. Create an A + Dynamic DNS Record for the host you wish to update (use * for a wildcard host).
    5. Scroll down to the DYNAMIC DNS section and toggle the switch to ON.
    6. Copy the Dynamic DNS Password that appears. This is the value you must use in the password field of your ddns-updater configuration.
  4. Configure DynDNS provider

    master

    To use DynDNS with ddns-updater, add a configuration object to the settings array with the provider set to "dyn". You must provide a domain, username, and client key. You can optionally specify the IP version and an IPv6 suffix for permanent address updates.

    {
      "settings": [
        {
          "provider": "dyn",
          "domain": "domain.com",
          "username": "username",
          "client_key": "client_key",
          "ip_version": "ipv4",
          "ipv6_suffix": ""
        }
      ]
    }
  5. Configure the Myaddr provider

    master

    To use the Myaddr provider in ddns-updater, add a configuration object to the settings array. You must provide a domain and a key. You can optionally specify the ip_version and an ipv6_suffix to manage how IPv6 addresses are recorded.

    {
      "settings": [
        {
          "provider": "myaddr",
          "domain": "your-name.myaddr.tools",
          "key": "key",
          "ip_version": "ipv4",
          "ipv6_suffix": ""
        }
      ]
    }
  6. Set up AWS Route53 user permissions

    master

    The DDNS updater requires a specific IAM policy to allow it to change record sets in your Route53 hosted zone. You can restrict the Resource to a specific hosted zone ARN or use a wildcard * to grant access to all hosted zones.

    {
      "Version": "2012-10-17",
      "Statement": [
        {
          "Effect": "Allow",
          "Action": "route53:ChangeResourceRecordSets",
          "Resource": "arn:aws:route53:::hostedzone/A30888735ZF12K83Z6F00"
        }
      ]
    }