Code Monkey home page Code Monkey logo

cloudflare-ddns-updater's Introduction

Cloudflare Dynamic DNS IP Updater

GitHub GitHub last commit (branch) GitHub contributors

This script is used to update Dynamic DNS (DDNS) service based on Cloudflare! Access your home network remotely via a custom domain name without a static IP! Written in pure BASH.

Support Me

Donate Via Paypal

Installation

git clone https://github.com/K0p1-Git/cloudflare-ddns-updater.git

Usage

This script is used with crontab. Specify the frequency of execution through crontab.

# ┌───────────── minute (0 - 59)
# │ ┌───────────── hour (0 - 23)
# │ │ ┌───────────── day of the month (1 - 31)
# │ │ │ ┌───────────── month (1 - 12)
# │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday 7 is also Sunday on some systems)
# │ │ │ │ │ ┌───────────── command to issue                               
# │ │ │ │ │ │
# │ │ │ │ │ │
# * * * * * /bin/bash {Location of the script}

Tested Environments:

macOS Mojave version 10.14.6 (x86_64)
AlmaLinux 9.3 (Linux kernel: 5.14.0 | x86_64)
Debian Bullseye 11 (Linux kernel: 6.1.28 | aarch64)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Reference

This script was made with reference from Keld Norman video.

License

MIT

cloudflare-ddns-updater's People

Contributors

agingorange avatar bioinformike avatar clementnuss avatar jjp17 avatar k0p1-git avatar lmarzen avatar ndrone avatar northportio avatar sailboat265 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cloudflare-ddns-updater's Issues

weird issues with cron

I have this set up on a ubuntu 21.10 server and it works great when I run it manually. It changes remote.domain.com to my public ip address almost instantly. I make a copy of the script and set it to change test.domain.com in a cron task running every minute. Doing a grep CRON /var/log/syslog shows it as running but nothing ever gets updated on the cloudflare side. It still just shows 8.8.8.8. Any thoughts? I am about to pull my hair out lol.

Logger error

hey i get an error on line 49 and 108 about logger command not found. im currently running it in windows with git bash but i want to use it in a truenas cron job
NpzuCmA

Discord webhook posting when the IP hasn't changed.

Got multiple webhook notifications saying its detected a new IP but the IP is exactly the same, its not consistent but random instead. The script is being ran every minute with CRON. Here's a screenshot for reference.
20220709023627

Error while executing

Hallo,

everytime I execute this script, I get this error:

root@raspberrypi:~/cloudflare-ddns-updater# ./cloudflare.sh
./cloudflare.sh: 17: [: 87.154.240.144: unexpected operator
./cloudflare.sh: 25: [: global: unexpected operator
./cloudflare.sh: 41: ./cloudflare.sh: [[: not found
./cloudflare.sh: 51: ./cloudflare.sh: [[: not found

record won't update

Hello. I'm trying to get this thing to work. Modified the variables, and the script run manually prints out the expected message to syslog:

Apr 16 15:52:51 myhostname myusername: DDNS Updater: Check Initiated
Apr 16 15:52:52 myhostname myusername: DDNS Updater: 1.1.1.1 mycomain.com DDNS updated.

But it is not changing on the site. I'm new to Cloudflare and I have just registered this domain. Running the request manually, seems like it doing something:

{
"result": [],
"success": true,
"errors": [],
"messages": [],
"result_info": {
"page": 1,
"per_page": 100,
"count": 0,
"total_count": 0,
"total_pages": 1
}

But when I try to get DNS Record Details, I get:

{
"result": [
{
"id": "blurred out",
"zone_id": "blurred out",
"zone_name": "mydomain.com", #ofc these are right
"name": "mydomain.com",
"type": "A",
"content": "8.8.8.8", #old stuff I'd like to get rid of
"proxiable": true,
"proxied": false,
"ttl": 1,
"locked": false,
"meta": {
"auto_added": false,
"managed_by_apps": false,
"managed_by_argo_tunnel": false,
"source": "primary"
},
"created_on": "2022-04-16T09:06:21.175273Z",
"modified_on": "2022-04-16T13:37:12.440559Z"
}
],
"success": true,
"errors": [],
"messages": [],
"result_info": {
"page": 1,
"per_page": 100,
"count": 1,
"total_count": 1,
"total_pages": 1
}
}

I also tried getting a logs with the Get User Audit Logs API call, but indeed, these are completely missing from them. The last logged action is my manual setting of this A record.

Why is telling me it's done its thing when it clearly has not?

I've tried to change the "proxy" variable to 'true' and turn it on on the site, then turned it off on the site and gave it "false" in the script, the exact same behavior.

Am I doing something wrong? Is there some kind of delay, like "we tell you your API calls were successful but changes won't happen cuz you're too fresh"? Ofc I've verified my mail and all that. Manually chaning IPs do work.

Idk if this is relevant, because pure API calls don't work, but hey, help out a brother

Duplicate DNS Record

Every time a update occurs the record I set to be updated is actually being duplicated with the new IP address and the old one remains and I have to remove it by hand. How can I fix it?

Add cron designations

I believe this is specific to Debian but cron would not run this script without designating the shell and path priority first:

SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/

Posting this for other noobs such as myself.

$record_name is always null

Although the updating is working perfectly, the $record_name variable in the logger output is persistently null.

I've tried specifying it with my other Cloudflare parameters in this format:

record_name="examplesite.com"

But this is clearly wrong (it generates an error), so I wonder if someone can tell me what data is expected by this variable.

I know this is a newbie question, so please accept my apologies in advance (together with my thanks for this excellent script!).

neil

DDNS Updater: Record does no exist

Hello, like most of the poeple visiting this repo, I am also from NetworkChuck 😅

I've followed all the steps from the video but I am having trouble updaitng my domains.
I also am terribly sleep deprived so I apologize in advance.
I am also a complete noob to networking and linux in general so I also apologize for that
For obvious reasons I have substitued my personal information

Here's what I have down in my cloudflare.sh

auth_email="myemail@myemail" 
auth_method="global"
auth_key="****"
zone_identifier="****"
record_name="speed.mydomain.com"
ttl="3600" 
proxy=true

And here's what I have on cloudflare

HLEP

But then when I run it I get this error:

root@UbuntuPiServer0:~/cloudflare-ddns-updater# ./cloudflare.sh
<13>Dec  6 22:26:01 ubuntu: DDNS Updater: Record does not exist, perhaps create one first? (myip) for speed.mydomain.com)
root@UbuntuPiServer0:~/cloudflare-ddns-updater#

but when change
record_name="speed.mydomain.com"
in
cloudflare.sh
to
record_name="mydomain.com"
it works perfectly fine

I don't know if it has anthing to do with an SRV record I added earlier:
yert

Really sorry if I did/said any really stupid stuff! I'm kind of a beginner.
Feel free to correct/guide me.

Thank you!

imgoingtosleepnow

API Issue

Trying to run api and getting this errors and idk how to fix this

./cloudflare.sh: 17: [: xx.xx.xxx.xx: unexpected operator
./cloudflare.sh: 25: [: global: unexpected operator
./cloudflare.sh: 41: [[: not found
./cloudflare.sh: 51: [[: not found

Script does nothing

i just downloaded the script and it looks like it just does nothing at all, why is this? i also have no logs because it just says nothing, i followed that tutorial: https://www.youtube.com/watch?v=rI-XxnyWFnM
the problem must be that script because my internet works fine and it was working before, i just decided to add that script just in case the ip changes (it does change usually every 6 months at my place)
maybe i made an mistake, i listed my steps below, i hope i did everything right:
(keys are altered)

#!/bin/bash
# change to "bin/sh" when necessary
auth_email="[email protected]" # The email used to login 'https://dash.cloudflare.com'
auth_method="global" # Set to "global" for Global API Key or "token" for Scoped API Token
auth_key="c1fr4b1fa67d25773430fd8ffaab4ag0dd5ad" # Your API Token or Global API Key

grafik

zone_identifier="c41602b25d8b8257298b1616aad6d8b0" # Can be found in the "Overview" tab of your domain
grafik

record_name="" # Which record you want to be synced
ttl="3600" # Set the DNS TTL (seconds)
proxy="true" # Set the proxy to true or false
sitename="pl.mchost.fun" # Title of site "Example Site"
slackchannel="" # Slack Channel #example
slackuri="" # URI for Slack WebHook "https://hooks.slack.com/services/xxxxx"
discorduri="" # URI for Discord WebHook "https://discordapp.com/api/webhooks/xxxxx"
###########################################
## Check if we have a public IP
###########################################

hope someone can help 👍

Cloudflare IP not updating

I have gotten this script to run without any errors but when I manually change one of my records on the Cloudflare dashboard, the script that is meant to change it does not. I have tried running it multiple times but to no avail. What should I do to find out more about why this is happening or how to fix it?

Here are the variables that I have set in the shell script file. Nothing else I have changed:

auth_email="[email protected]"             
auth_method="global"            
auth_key="REDACTED"           
zone_identifier="8b073b276e41fd6b61a6658678a83981"
record_name="node1"
ttl="3600"
proxy="true"
sitename="artichokemc.net"
slackchannel=""
slackuri=""
discorduri="https://discord.com/api/webhooks/REDACTED"

slackchannel? What is it job?

Been lookin in to slack. And must be doing something wrong or something but I don't see point in script variable slackchannel.
slackchannel="" # Slack Channel #example
It dosn't seam to do anything. It could be null value, it could have a Slack channel under my account, could be set anything like total random nonsence. Make no diffrance.
You could remove code on line 87 and 97 and still works.
"channel": "'$slackchannel'",

So what is job? Because I would nice if webhooks I have that would be able to post another channel, but it will only post to channel that defiened when creating that webhook.

Automatically updated ip address (subdomain) differes from the ip of the main domain

Hey guys,

I'm very new to this topic so please excuse stupid questions of mine.

I created a subdomain and gave it a random ip address to see if it will be changed by the script later. I then set up the script and checked, if the ip address of the subdomain was updated. It did. However, the automatically updated subdomain ip address differes from my main domain address.

Is this normall or should they be equal? The reason I am asking is that whenever I try to visit my subdomain via browser, I get a connection error, while visiting my main domain works just fine.

If they should indeed match, I'd be very thankful for advice on how to fix this. Since the script works, I am quite sure to ave entered tokens, etc. correctly. But maybe there is another information or setting I have to enter/change.

Thank you in advance for your help!

where to find the url used for updating my dynamic ip

I am trying to set ddns to work with raspberry pi 4 using dietpi
they have built in ddns with custom ddns provider option and they ask for " the full URL used to update your dynamic IP against your custom DDNS provider " where I can find that

I would like to add a Telegram Notification

Nice script thanks I have been playing around with adding a Telegram alert like slack and discord and it seems to work ok just needs an extra notification section like the others if you are interested i can share what i have working ?

Multi A records

Is there a way to change multiple dns A rcords with this script.
if so how can i get this to work?

record_name="example1.com,example2.com"

Ensure Cloudflare is returning a valid IP address before comparing old_ip to current IP

Cloudflare API is down today and as a result at random returns the following instead of the IP address:
{"success":false,"errors":[{"code":10000,"message":"Internal authentication error: internal server error"}]}

The causes $old_ip == $ip to fail and force a IP update.

FIX:
Sanitize and ensure that the returned string from the API call is actually an IP before comparing. Suggested snippet below adds a comparison to ensure $old_ip is a valid IP first:

if [[ $old_ip =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$ ]]; then # <== NEW

        # Compare if they're the same
        if [[ $ip == $old_ip ]]; then
        logger "DDNS Updater: IP ($ip) for ${record_name} has not changed."
        exit 0
        fi
fi

[Question]

I'm just getting started with Cloudflare.
I have two DNS 'A' records set up in the Cloudflare dashboard - one for my root domain and a wildcard record for the subdomains.
Will your script work for this setup?
Would I have to run it twice, once for each record? And if so, will it handle the wildcard record correctly?

Could not route to /client/v4/zones/XXXX/dns_records, perhaps your object identifier is invalid?"

Hi,
Thanks for your script, but Im having some problems making it works.
I setted the variables like zone_identifier, record_name, auth_email, auth_key but it doesn't work.

I get this message in syslog:

DDNS Updater: Check Initiated
DDNS Updater: 105.5.186.29 example.example.es DDNS updated.

But the record doesn't change in cloudflare, so I write "set -x" at the begining of the script and I saw the problem:
When the script try crul command to get the zones it get an error:
[[ {"result":null,"success":false,"errors":[{"code":7003,"message":"Could not route to /client/v4/zones/example.es/dns_records, perhaps your object identifier is invalid?"}],"messages":[]} == *\"\c\o\u\n\t\"\:\0* ]]

Note: I changedd the Ip and the domain for private reasons.

Multiple ddns updates

Finally a script that works flawless! Thanks for that!

Only thing that is missing is a multi domain config file that can be used. I have 8 domains but I don't want 8 scripts ;-)
Is that something that can be considered ? If so, I can offer myself as beta tester ;-)

Keep up the good work !

the IP in Cloud Flare doesn't get updates

Hi

I'm running the latest version as im writing this, I have tried everything but still the IP in CloudFlare doesn't update. So is there anything I have to do in Cloud Flare. I didn't get any output from the script.

Update loop without correct updates

Hey,
i have the problem, that the script works like it should according to the logs but the actual content of the A record isn't updated.
The script is in a update loop but dont update the content. I checked all auth inputs multiple times.

Do you think you can help me?

Log

Suggest: allowing for multiple record_names

I came here from NetworkChuck, and at the end he tells viewers they can just set up CNAME records so they don't have to run this script for each subdomain. But that's not the whole story, as I believe it's normal practice to have two A records: mydomain.com, and www.

What I've taken to doing is passing record_name as a command line argument and just running two cronjobs, like so:

# cloudflare-init.sh
# ...
zone_identifier="abc123efg456" 
record_name=$1
ttl="3600"
# ...
# crontab
*/5 * * * * /bin/bash /home/user/cloudflare-ddns-updater/cloudflare-init.sh mydomain.com
*/5 * * * * /bin/bash /home/user/cloudflare-ddns-updater/cloudflare-init.sh www.mydomain.com

I suppose I could submit a PR with a for-loop wrapping the entire contents of the script, going through arguments until there are none left... but I am not a bash aficionado and perhaps someone has a better way or a better overall solution?

errors when run

I get the following errors when I run the script. I have tried it on Ubuntu 20.04.3(VM), Ubuntu 21.04(VM), and Raspbian OS Lite(Raspberry Pi 4).

./cloudflare.sh: 17: [: : unexpected operator
./cloudflare.sh: 25: [: global: unexpected operator
./cloudflare.sh: 41: [[: not found
./cloudflare.sh: 51: [[: not found

Works on Raspberry Pi, but not on Mac

The script has worked perfectly fine for almost a year on a Raspberry Pi. However, when I run it on my Mac mini (macOS 13.6), it runs fine with no errors, but does not update the Cloudflare DNS entry. I am simply copying the same exact script file over.

The Pi and Mac are on different subnets, but nothing should be getting blocked on the Mac.

Output of bash -x ./script.sh

+ auth_email=[REDACTED]
+ auth_method=global
+ auth_key=[REDACTED]
+ zone_identifier=[REDACTED]
+ record_name=[REDACTED]
+ ttl=3600
+ proxy=false
+ sitename=
+ slackchannel=
+ slackuri=
+ discorduri=
+ ipv4_regex='([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])'
++ curl -s -4 https://cloudflare.com/cdn-cgi/trace
++ grep -E '^ip'
+ ip=ip=[REDACTED]
+ ret=0
+ [[ ! 0 == 0 ]]
++ echo ip=[REDACTED]
++ sed -E 's/^ip=(([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5]))$/\1/'
+ ip=[REDACTED]
+ [[ ! [REDACTED] =~ ^([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])$ ]]
+ [[ global == \g\l\o\b\a\l ]]
+ auth_header=X-Auth-Key:
+ logger 'DDNS Updater: Check Initiated'
++ curl -s -X GET 'https://api.cloudflare.com/client/v4/zones/[REDACTED]/dns_records?type=A&name=[REDACTED]' -H 'X-Auth-Email: [REDACTED]' -H 'X-Auth-Key: [REDACTED]' -H 'Content-Type: application/json'
+ record='{"result":[{"id":"[REDACTED]","zone_id":"[REDACTED]","zone_name":"[REDACTED]","name":"[REDACTED]","type":"A","content":"9.9.9.9","proxiable":true,"proxied":false,"ttl":3600,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-01-21T16:18:28.453902Z","modified_on":"2023-10-14T14:17:01.335789Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}}'
+ [[ {"result":[{"id":"[REDACTED]","zone_id":"[REDACTED]","zone_name":"[REDACTED]","name":"[REDACTED]","type":"A","content":"9.9.9.9","proxiable":true,"proxied":false,"ttl":3600,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-01-21T16:18:28.453902Z","modified_on":"2023-10-14T14:17:01.335789Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}} == *\"\c\o\u\n\t\"\:\0* ]]
++ echo '{"result":[{"id":"[REDACTED]","zone_id":"[REDACTED]","zone_name":"[REDACTED]","name":"[REDACTED]","type":"A","content":"9.9.9.9","proxiable":true,"proxied":false,"ttl":3600,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-01-21T16:18:28.453902Z","modified_on":"2023-10-14T14:17:01.335789Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}}'
++ sed -E 's/.*"content":"(([0-9]{1,3}\.){3}[0-9]{1,3})".*/\1/'
+ old_ip=9.9.9.9
+ [[ [REDACTED] == 9.9.9.9 ]]
++ echo '{"result":[{"id":"[REDACTED]","zone_id":"[REDACTED]","zone_name":"[REDACTED]","name":"[REDACTED]","type":"A","content":"9.9.9.9","proxiable":true,"proxied":false,"ttl":3600,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-01-21T16:18:28.453902Z","modified_on":"2023-10-14T14:17:01.335789Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}}'
++ sed -E 's/.*"id":"(\w+)".*/\1/'
+ record_identifier='{"result":[{"id":"[REDACTED]","zone_id":"[REDACTED]","zone_name":"[REDACTED]","name":"[REDACTED]","type":"A","content":"9.9.9.9","proxiable":true,"proxied":false,"ttl":3600,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-01-21T16:18:28.453902Z","modified_on":"2023-10-14T14:17:01.335789Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}}'
++ curl -s -X PATCH 'https://api.cloudflare.com/client/v4/zones/[REDACTED]/dns_records/{"result":[{"id":"[REDACTED]","zone_id":"[REDACTED]","zone_name":"[REDACTED]","name":"[REDACTED]","type":"A","content":"9.9.9.9","proxiable":true,"proxied":false,"ttl":3600,"locked":false,"meta":{"auto_added":false,"managed_by_apps":false,"managed_by_argo_tunnel":false,"source":"primary"},"comment":null,"tags":[],"created_on":"2023-01-21T16:18:28.453902Z","modified_on":"2023-10-14T14:17:01.335789Z"}],"success":true,"errors":[],"messages":[],"result_info":{"page":1,"per_page":100,"count":1,"total_count":1,"total_pages":1}}' -H 'X-Auth-Email: [REDACTED]' -H 'X-Auth-Key: [REDACTED]' -H 'Content-Type: application/json' --data '{"type":"A","name":"[REDACTED]","content":"[REDACTED]","ttl":"3600","proxied":false}'
+ update=
+ case "$update" in
+ logger 'DDNS Updater: [REDACTED] [REDACTED] DDNS updated.'
+ [[ '' != '' ]]
+ [[ '' != '' ]]
+ exit 0

Output of debug script dev-ipv4.sh

Oct 14 09:47:47  peter[10813] <Notice>: DDNS Updater: Check Initiated
./dev-ipv4.sh: line 112: -4: substring expression < 0
./dev-ipv4.sh: line 163: -4: substring expression < 0
Oct 14 09:47:47  peter[10828] <Notice>: DDNS Updater: [REDACTED] [REDACTED] DDNS updated.

adding systemd timers + service files & instructions to README.md or directory

Hi,
As I prefer to keep everything managed through config files and sentralized to systemd services, I have created some basic configuration files and a timer for using this script w. systemd. I was wondering if a PR with these files (and some instructions) would be likely to be accepted, or would be rejected on the basis of the primary maintainer not wanting to "support" systemd.

If you're positive, I'll polish the files/instructions a little and make a PR. If you're not, I'll just publish them to my own public repo.

//fm

Issue line 16

for some reason I execute the script and this is the error I receive:
./cloudflare.sh: line 16: curl: command not found
./cloudflare.sh: line 16: curl: command not found
<13>Oct 7 00:52:59 spartan: DDNS Updater: No public IP found

Here is Line 16-21:
ip=$(curl -s https://api.ipify.org || curl -s https://ipv4.icanhazip.com/)

if [ "${ip}" == "" ]; then
logger -s "DDNS Updater: No public IP found"
exit 1
fi

Support for multiple records [Reference @jeidnx comment on 24th Jan]

Hey there,
Should this project support updating multiple records? This would involve either changing the record_name variable to record_names or having a second variable for multiple records altogether, although i don't see the point in that. I have already implemented this in a custom version of this script i use here.

[Discussion] remove the ttl and proxy variables

The ttl and proxy variables can be omitted from the cf api call which will result in them staying the same as they were. As these are not updated dynamically i would suggest omitting them from the script and leaving them to the cloudflare dashboard.

Possibility to take IP from another gateway

Hi there,
at my home I have 2 connections. (ADSL and 5G)

I want to run the script in a server, but I want to take the IP from another router (gateway).
Is this possible please ?

Thanks in advance
Denis

Record Does Not Exist

Hello, I've used this script in the past and it is great! I am having a hard time setting it up for another domain though. I keep getting this error message. The domain record that the script can't seem to find will resolve when I check online so I'm not sure where to start.

A<13>Oct 3 12:34:27 root: DDNS Updater: Record does not exist, perhaps create one first?

not working

cloudflare.sh: 22: [[: not found
cloudflare.sh: 31: [[: not found
cloudflare.sh: 39: [[: not found
cloudflare.sh: 58: [[: not found
cloudflare.sh: 68: [[: not found
cloudflare.sh: 109: [[: not found
cloudflare.sh: 116: [[: not found

DDNS Updater: Failed to find a valid IP

Any advice on how to fix this?
./cloudflare2.sh: line 21: curl: command not found
./cloudflare2.sh: line 24: curl: command not found
./cloudflare2.sh: line 24: curl: command not found
<13>Jan 27 02:46:17 tech: DDNS Updater: Failed to find a valid IP.

TXT spf1 updater

Greetings! I try to use cloudflare to manage my email server's dns records too and i need an spf1 record but for that, i have to update the ip adress in the code too. Is there a way i can use your to do this please? What should i change in the code? Thank you!

The data should seems like this:

v=spf1 ip4:8.8.8.8 include:exampledomain.com~all

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.