mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 10:38:41 -04:00
Bug: Porkbun root domain update states failure, but IP gets updated correctly anyway (subdomains work without failure) #479
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @mmarszal on GitHub (Dec 30, 2024).
TLDR: Porkbun DNS updates work without problem for subdomains, but root domain always delivers an error (but updates the IP anyway)
Is this urgent: No
DNS provider(s) you use: Porkbun
Program version:
Running version latest built on 2024-12-24T09:20:36.130Z (commit 78f3061)What are you using to run the container: docker-compose
Extra information (optional)
Logs:
Configuration file (remove your credentials!):
Host OS: Debian 12, ddns-updater running under docker with official image
Hi everyone, I've been using ddns-updater with a few different providers, and it is mostly working quite well.
I mainly have a problem with pork bun returning an error while trying to update the root domain IP.
The funny thing is that the update works, but an error always gets returned only for the root domain (listed in logs above). All subdomains get updated properly without error. I replaced all secret information above with XXX when necessary.
Any idea what I can do to get the updates to return cleanly?
Thanks, and I appreciate the work that goes into this client!
@mmarszal commented on GitHub (Jan 2, 2025):
Just a quick update. I tried using the POST commands that ddns-updater uses (found from the DEBUG logs) within a rest client, and the update works perfectly without errors. I wonder if the problem lays somewhere else.
@mmarszal commented on GitHub (Jan 2, 2025):
I did some further analysis. I found how to make the request fail now. The
Edit error: We were unable to edit the DNS record.error happens when ddns-updater tries to update the IP address when the IP address doesn't need a change. It looks like the pork bun API returns an error when the call tries to update the IP with the same value. I was able to check this using a REST client.So it looks like ddns-updater is trying to update the IP when it doesn't need to.
@LnLcFlx commented on GitHub (Jan 4, 2025):
I'm experiencing the same problem.
@bentemple commented on GitHub (Jan 8, 2025):
I'll take a look into this
@bentemple commented on GitHub (Jan 8, 2025):
So, the "porkbun will fail if you try to update a record to the same value" is known. Was this an issue you experienced initially but are no longer getting?
How ddns-updater works, is it cycles through multiple DNS servers for each validation check (by default) checking the IP for your domain. i.e. root.domain
so, given a dns lookup of root.domain returning a value 0.0.0.0
It then goes to porkbun, with the first request you see:
the A record here has a value of "XXX.XXX.XXX.XXX"
Then, if that value it got from the DNS lookup isn't correct, it will create or update the record, but it doesn't validate that porkbun is already set to the correct value.
Because the correct value already is set on the record, you're going to get that error. That being said, this should be a transient only issue and as soon as the DNS records properly propagate, it should stop trying to update the record and won't show any more failures.
So my guess here, is that this is mostly just a transient "I just setup DDNS updater, and maybe setup a test IP prior to letting DDNS setup the DNS" issue vs a long-running issue. does that sound correct?
I think I had proposed code to do an additional validation check to ensure we don't call update if the value is already correct, but ultimately that shouldn't be necessary, though it likely is what presents this somewhat confusing error case.
You can see the logic here
So if we just change that to:
I believe that would resolve this transient issue, but then it would mask the issue that some dns server has the wrong record value for your domain because the propagation hasn't happened yet. So I think it's better to have a transient error than to hide that error-case given that it should resolve itself once the new DNS record finishes propagating.
@mmarszal commented on GitHub (Jan 10, 2025):
Hi bentemple,
Thanks for looking into the issue. Now that you mention transient dns, I wonder if it has to do with my local dns server using optimistic caching. I wonder if ddns-updater is resolving the old ip address. This issue is still on going for me, and my IP just updated a few hours ago, with all my domains updating, but then showing the error 5 minutes later as it still sees the old ip. Here is snippet of the logs:
Then 5 minutes later
It's only about 10 minutes later from the last error that ddns updater sees the new ip
@bentemple commented on GitHub (Jan 14, 2025):
So I agree, this sounds like a local DNS cache look-up error.
Let's walk through the code:
So, that's your router's DNS, so if it's caching it for longer than the default cool-down, it would I believe cause this.
Probably 3 ways you could fix this. Set a specific DNS RESOLVER_ADDRESS to do the look-up not using your local router's DNS, extend the cool-down PERIOD to be longer than 5m, or just update your router's DNS to cache for a shorter period of time.
(Env variables for these settings)
@mmarszal commented on GitHub (Jan 14, 2025):
Thanks for the detailed explanation. I will try to use a specific address for resolving the DNS.
I will observe the changes over the next few days to see what happens once my IP changes.
I guess what was really perplexing me, was that my other domains using NameCheap never had this problem. But now that I think about it, the NameCheap api probably accepts updating a domains IP to one that is already in use, while PorkBun treats this as an error.
I will update the issue after testing this out when the IP changes. Thanks again for looking into this and helping diagnose this.
@mmarszal commented on GitHub (Jan 18, 2025):
Hi again,
I think we can close the issue now. I setup the container to use an external dns server as the resolver as per your suggestion, and over the last 2 days, my domains IP addresses were able to be updated multiple times without a single issue. It really does look like it was just a caching issue from my local DNS server.
Thanks again for the help with finding the root cause of the issue!