Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cloudflare DNS Entry Gets Updated Only once at startup (When service starts) #70

Closed
parhamsan opened this issue Jul 28, 2024 · 8 comments

Comments

@parhamsan
Copy link

parhamsan commented Jul 28, 2024

Hello,

First of all I want to thank you for this great tool!

I have an issue with the latest build (tested on windows server 2022 and Windows 11) where my IPV4 only gets updated at startup.
If I change the IP of my main domain to lets say 8.8.8.8 on CF, my IP doesnt get updated after the first time service starts.

I have both IPV4 and IPV6 but for now I have removed my AAAA+ record on CF so just IPV4 A record.

my settings are:

email: CF email address
Using token
Zone ID is correct
Protocol: IPV4
IPv4 API: https://api.ipify.org/
Update interval: 1min
Network Adapter (requires service restart): Default (also tried my 10gb nic with static IP)

If I stop the service and start it again, the IPV4 gest updated on CF; however if i change my IP on CF manually, the service does not update the IP.

So in the example that I have attached, I changed the last digit of my IP to 4 to see if gets updated but it doesnt get updated to 5.

The first image is at startup, so it updates my IPV4 entry for my domain on CF:
1
2
3
4

I can confirm that the service detects the correct IPV4 when I open the webpage http://localhost:5666/index.html.

Let me know what could be wrong here.

Thanks.

@drittich
Copy link
Owner

This behavior is more or less by design. I don't want the app pounding the Cloudflare API on each poll, and if you are going to simultaneously let DnsTube manage your dynamic DNS and edit it manually you'll run into problems, since which one should win? If you do edit it manually for some reason, then remember to restart DnsTube.

@drittich
Copy link
Owner

On review I see you did a manual update. I think it's reasonable in this circumstance to hit the API - I'll look into adding that.

@parhamsan
Copy link
Author

I see, that makes sense now cuz I just restarted my router manually to get a new WAN IP, and saw that DnsTube updated the IP on CF with the new WAN IP.

So I am guessing this is how it works, at startup it checks both WAN IP and CF IP, if different it will change it on CF.
During the checking process, it will update CF api only if the current WAN IP is different from the one stored in the program and not on CF API!

Thanks for getting back to be so fast and thanks for the explanation!

@parhamsan
Copy link
Author

On review I see you did a manual update. I think it's reasonable in this circumstance to hit the API - I'll look into adding that.

Correct I did a manual change on the API to see if DnsTube changes it or not, I mean you are correct you don't want to hit the API constantly like I set it for 1 min. But again some DNS services have limitations on how often you can hit the API and that's the problem I had with Namecheap. Didn't see any for Cloudflare.
With Namecheap, If my WAN IP changed, the min time to change it on the DNS server (with their DDNS updater) was 15min.
After my switch to CF, and With your tool it gets updated in a minute which is perfect and TTL on Cloudflare is pretty low!

Maybe something to consider for later builds!
Nevertheless, I thank you again for this great tool!!!

@drittich
Copy link
Owner

I've created a beta version that forces a Cloudflare update when you do a manual update. Give v2.7.0-beta a try and let me know how it works for you.

@parhamsan
Copy link
Author

Hey,
I can confirm that if I manually change the IP on CF API and click on "Update Now" on the top right corner of the "IP Address" section on the "HOME" page the IP address of the CF API gets updated.

This works, however what I have in mind was that if DnsTube detects that the CF API IP is different from the WAN IP, it automatically changes the CF IP on every check interval correct!

@drittich
Copy link
Owner

Thanks for the update. I'm going to stick with this halfway measure for now, as I do not want to hit the CF API that frequently and I think this is a bit of an unusual use case.

I'm open to re-considering this in the future, perhaps with a configurable setting Call Cloudflare API on every sync that defaults to false.

@parhamsan
Copy link
Author

Thanks for the update. I'm going to stick with this halfway measure for now, as I do not want to hit the CF API that frequently and I think this is a bit of an unusual use case.

I'm open to re-considering this in the future, perhaps with a configurable setting Call Cloudflare API on every sync that defaults to false.

Sounds very fair,
Thank you very much for following up on this matter!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants