scotthelme / cloudflareddns Goto Github PK
View Code? Open in Web Editor NEWCreate your own DDNS service with CloudFlare
License: MIT License
Create your own DDNS service with CloudFlare
License: MIT License
Will this work with one domain with multiple dynamic ips?
I have gone through the config of the variables in the .php and .sh files but when I run the .sh file cloudflare isn't updated but there also isn't any detail in the log:
burntsky@blackmane:~/CloudFlareDDNS$ sudo ./updateCloudFlare.sh burntsky@blackmane:~/CloudFlareDDNS$ cat /var/log/ddns.log Tue Apr 2 12:31:31 BST 2019 Tue Apr 2 12:33:59 BST 2019 Tue Apr 2 13:27:20 BST 2019 Tue Apr 2 13:27:25 BST 2019
If I run the wget command without the auth post I get the error as expected so it feels like the hosting of the php file is ok:
burntsky@blackmane:~/CloudFlareDDNS$ wget -4qO- http://192.168.2.48/updateCloudFlare.php Authentication required
Any thoughts what I may have done wrong?
Please choose a license.
Hey @ScottHelme, just wanted to let you know that I made a node version of your project !
th3m4ri0/cloudflare-ddns.js
Your project was its inspiration ;)
Array
(
[0] => stdClass Object
(
[code] => 6003
[message] => Invalid request headers
[error_chain] => Array
(
[0] => stdClass Object
(
[code] => 6103
[message] => Invalid format for X-Auth-Key header
)
)
)
)
The value passed to the update has a value for service_mode. This value needs to be captured from the rec_load_all API call.
Add this variable after $cfIP:
$serviceMode = ''; // The service_mode for the subdomain
Set it after setting $cfIP:
$serviceMode = $rec->service_mode;
Use it in the rec_edit API call:
'service_mode' => urlencode($serviceMode),
Almost every device have dyndns integrated in their firmware so is there any dns server that can change the requests to dyndns to cloudflare ?
The idea came from Here . Nintendo closed it's old servers and some people developed their own DNS server and changes the requests made to Ninetendo's server to their own server.
I cannot change my domain ip, fixxes?
No errors
It is more efficient if you do a direct DNS query before doing the more expensive HTTP call from CloudFlare:
Add this before the code starting at:
// Build the initial request to fetch the record ID.
$dnsa = gethostbyname($ddnsAddress);
if ($ip != $dnsa) {
and a } at the end.
Hello,
When I run your PHP file, I end up getting an IP of 192.168.1.1 from the default option, and an error code from the secondary option you presented.
The error message will be posted below, and I can provide the files that I'm using as well.
Mon Feb 18 01:46:22 MST 2019
Errors:
Array
(
[0] => stdClass Object
(
[code] => 1004
[message] => DNS Validation Error
[error_chain] => Array
(
[0] => stdClass Object
(
[code] => 9102
[message] => content must be a string.
)
)
)
)
Hi, I just updated your script to loop through several domains and dozens of subdomains and update it in one call.
I can send you a copy of it if you like?
ADD: Also, thank you so much for this script. Exactly what I needed!
AND: If it detects a local IP address, it will outsource to get a public IP address for folks who self host, or call API from another machine.
Also, I don't think using the URL would work if the IP address changed since the DNS wouldn't have been updated. It might be better to use /usr/bin/php to execute PHP file.
PHP can also be run in CLI, no server needed.
what about updating multiple hosts of multiple root domains I'm thinking of modifying the script to my specific configuration but I'm sure you have a better approach than me that would be more generic?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.