mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-08-02 18:48:49 -04:00
Handle Cloudflare's proxied IP addresses #65
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 @itsikg on GitHub (Sep 27, 2020).
Originally assigned to: @qdm12 on GitHub.
What's the feature?
Cloudflare allows creating DNS records that will be "masked" (proxied) from the public. When pinging or nslookup the host name, the results will not contain the actual IP address but proxies.
It seems the updater is not aware of that and each cycle it discovers that it has a different IP address than the one on the DNS and triggers a record update. This happens every 5 minutes and could cause a ban / block from the provider.
I suggest using a different method to check for an IP change. I assume using Cloudflare's API might help.
Why do you need this feature?
To reduce the IP change requests from the provider.
Extra information?

For the same reason, I had to use "no_dns_lookup" because the healthcheck kept reporting "unhealthy"...
Attaching an image of Cloudflare's A record format.
@qdm12 commented on GitHub (Sep 27, 2020):
Indeed, thanks for reporting the issue!
Can you please try with
qmcgaw/ddns-updater:nolookup-updatesee if it works?Doing an API call to list the records would still do an API call every n minutes, which is not ideal.
Instead I just use the last IP stored in the json file to see if the public IP address changed.
It should work, but let me know if you encounter any problem 😉
@itsikg commented on GitHub (Sep 27, 2020):
Wow, that was fast 😀
I relaunched the container using the new branch and it is now working as expected. No IP change was triggered since the public IP has not changed.
Thank You 👍
@qdm12 commented on GitHub (Sep 27, 2020):
Alright perfect! Merging it now! And also thanks for the Paypal donation 🥇
@jt196 commented on GitHub (Nov 14, 2020):
@qdm12 I'm experiencing a similar problem with a similar set up. Cloudflare, proxied. Weirdly I'm only getting an error message for one of the subdomains, not the others. I can't figure out what is different about it.
The DDNS-updater also seems to update subdomains (not the wildcard) that don't need their IP addresses updating.
I've tried using the image you recommended but the problem persists.
This is the structure of my json config file:
I've put an entry for each of the subdomains that I have on the DNS records, not sure if that's correct but I had to do this to get my certs working.
@qdm12 commented on GitHub (Dec 6, 2020):
I think you need to add
"no_dns_lookup": trueto that subdomain so the healthcheck doesn't try to resolve it.For now the program sends 2 http requests (together with auth headers):
Get the identifier from
https://api.cloudflare.com/client/v4/zones/<zone-identifier>/dns_records?type=A&name=subdomain.domain.com&page=1&per_page=1Send a PUT request to
https://api.cloudflare.com/client/v4/zones/<zone-identifier>/dns_records/<identifier>with bodyHOWEVER It seems the
"name"value should be subdomain.domain.com, so I just changed that. Please wait for the build to finish, pull:latestagain and try to see if it solves it?I also wanted to apologize for the inconvenience and the delay in answering 😉