Git Product home page Git Product logo

cloudflareddns's Introduction

CloudFlareDDNS

Create your own DDNS service with CloudFlare.

The updateCloudFlare.php will allow you to update an existing DNS record in your CloudFlare account using the CloudFlare API and your API key.

Update the PHP file with your own details and host online. Call the file with a cron job every 5 minutes to regularly update your DDNS entry.

*/5 * * * * /home/user/updateCloudFlare.sh

Read more on my blog: https://scotthel.me/cfddns

cloudflareddns's People

Contributors

adnidor avatar aetherc0r3 avatar j-mie avatar scotthelme avatar theel0ja 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  avatar  avatar  avatar  avatar

cloudflareddns's Issues

need to capture service_mode value

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),

Is there any dns to do the same?(Not an issue)

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.

Unable to determine external IP

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.
                        )

                )

        )

)

Not updating but no feedback

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?

add test for IP using direct dns query

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.

Multiple zones and subdomains update (not issue)

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.

i problem help me

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
)

            )

    )

)

Updating multiple hosts of multiple root domains

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?

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.