Script to update dynamic DNS on Cloudflare, only tested with Fritz.box
Go to file
Phillip Nicholas Thern c19ab39f1c Update 'README.md'
Signed-off-by: Phillip Nicholas Thern <pt@ftt.gmbh>
2022-08-17 09:07:55 +00:00
LICENSE Initial commit 2022-08-16 23:38:08 +00:00
README.md Update 'README.md' 2022-08-17 09:07:55 +00:00
dyndns.js initial commit 2022-08-16 23:39:18 +00:00

README.md

dyndns

Script to update dynamic DNS on Cloudflare, only tested with Fritz.box

in Fritz.box Internet/Freigaben choose DynDNS, select "custom", and enter the update URL like this:

http://ip-of-machine-running-script-in-your-network:5555/?d=<domain>&ip=<ipaddr>

as username, use your cloudflare email address, and as your password, your Cloudflare API key. I recommend a subdomain of your main domain name looking like this: ddns[x].example.tld, x being an optional iterator if you are supplying multiple routers with dynamic DNS

since your data will be submitted in the clear, DO NOT run this script on a server outside of your own network (unless you really know what you're doing). I use a raspberry pi for this.

When your Router's IP changes, it will notify the script of its new data. The Script will query Cloudflare for the List of Zones to get the id of the zone in which your dynamic dns domain lies, and then it will search this zone for the domain record you have designated as dynamic. After these two steps have succeeded, it will either create a new zone record if there is no entry matching the designated domain with an A record containing the new IP of your router, or, if a record exists of type A (likely created by the prior process) or a CNAME (likely designated when you used a 3rd party dynamic DNS), it will change the A content (and also change the type to A if it was CNAME)

since my ISP only supports ipv4 on my plan, I have not implemented ipv6.