qdm12 / ddns-updater

Container to update DNS records periodically with WebUI for many DNS providers
https://hub.docker.com/r/qmcgaw/ddns-updater/
MIT License
1.73k stars 164 forks source link

Bug: Updates without cause and Noisy SHOUTRRR #573

Open AdyGCode opened 10 months ago

AdyGCode commented 10 months ago

TLDR: DDNS-Updater updates when no IP change

  1. Is this urgent: MEDIUM

  2. DNS provider(s) you use:Dynu, DuckDNS

  3. Program version:

    Running version latest built on 2023-11-17T14:08:09.354Z (commit ba2e777)

  4. What are you using to run the container: docker-compose

  5. Extra information

I've been running the service and noted something that could be improved.

I note that every time the app checks the IP, it forces an update to the DDNS even if there is no change in the IP address. This then leads to the "SHOUTERRRRRRRRRRRR" being very noisy and updating even when no change in IP has been made.

A good fix would be to make sure that the IP address is checked against the previous IP address, and only if a change is noted, then this cause the update to the DDNS and to the notifications.

If you need to force an update at a regular interval, then I would add a force-update interval configuration option (default every 24 hours) and a per DDNS service force-update that is optionally available in the config JSON file.

Unfortunately, I am not a Go programmer so, not able to fix this issue.

Host OS: MacOS (for testing)

qdm12 commented 9 months ago

The program does a DNS lookup (A or AAAA or both) to check if the IP changed and does not do an update if it matches the last updated IP on file (in updates.json).

Are you using both IPv4 and IPv6? A bug just got fixed today with commit 7ed63a036ef310f24373802b89e2ac946844f2ca which was causing a mix-up of IPv4 and IPv6 in the code, so maybe that could had been the cause?

It would be nice if you can share more about your configuration (removing actual domain names and keys). Thanks!

SlavikCA commented 8 months ago

I have similar issue:

I use ipv4 only.

and here is what I have in my updates.json:

cat data/updates.json

{
  "records": [
    {
      "domain": "***.****",
      "host": "@",
      "ips": [
        {
          "ip": "104.63.172.143",
          "time": "2024-01-26T16:57:20.186846272Z"
        },
        {
          "ip": "104.63.172.143",
          "time": "2024-01-26T17:13:07.867953704Z"
        },
        {
          "ip": "104.63.172.143",
          "time": "2024-01-26T17:25:17.681410714Z"
        },
        {
          "ip": "104.63.172.143",
          "time": "2024-01-26T17:31:02.793419802Z"
        },
        {
          "ip": "104.63.172.143",
          "time": "2024-02-14T23:42:47.748162983Z"
        }
      ]

As you can see, the IP is same...

All dates in the list above is approximately when I was restarting my container.