Closed Frans-Willem closed 1 year ago
Oh, that's interesting. Plausible theory! I'm mobile so I can't check right now, but I'd happily review a PR if you're up for it. Or I'll try to take a look at and fix it in a while.
Reading the code, I can confirm this is an issue. There's a logic problem with the handling of records. It throws all the current IPs in a bag regardless of the domain or IP version, so there's no opportunity later for the code to determine which individual domains are out of date.
The lookupCurrentIPsFromDNS
function needs to be rewritten to return the current known IP per domain, per type. A bit of a complicated nested structure, but it would be the best way to go to make sure the correct subset of modifications are performed.
If you intend to update two domains (say A.com and B.com), and A.com is correct, but B.com is outdated or incorrect, this utility will still not update B.com at startup I believe this to be caused by the fact that the lastIPs table is filled from the current DNS domains, and will at that point contain both correct and outdated IP, and then upon receiving a response from one of the IP providers it will consider it to not be renewed as it is already contained in lastIPs.