• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

Dynamic DNS Cloudflare v4 API issues with pfSense

Scheduled Pinned Locked Moved DHCP and DNS
28 Posts 11 Posters 13.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D
    doktornotor Banned
    last edited by Feb 24, 2017, 3:01 PM

    I keep wondering whether these DynDNS providers actually have any interest in people using their service. The amount of breakage and useless, super-complicated API changes is disturbing. Not exactly convinced this is worth the maintenance effort.

    1 Reply Last reply Reply Quote 0
    • S
      sandman06
      last edited by Feb 25, 2017, 10:14 AM

      same for me, not working and cant update A record, which i think where the issue is.

      1 Reply Last reply Reply Quote 0
      • B
        borgotech
        last edited by Feb 27, 2017, 5:14 PM Feb 26, 2017, 8:56 PM

        Hey.. my Cloudflare DynamicDNS works only with subdomains zones,  ( ex: hostname field hostname –---domain field mydomain.com >> Save  … & it works but when i try to add another record only for mydomain.com   ex: hostname field empty –---domain field mydomain.com >> Save  >>>> & i get "The hostname contains invalid characters."

        I tried another option like: hostname field mydomain –---domain field com >> Save  .. & i get " /services_dyndns_edit.php: phpDynDNS (mydomain.com): (Error) Zone or Host ID was not found, check the hostname." 
        This are my logs:

        Feb 27 19:00:57	php-fpm	55946	/services_dyndns_edit.php: Dynamic DNS: updatedns() starting
        Feb 27 19:00:57	php-fpm	55946	/services_dyndns_edit.php: Dynamic DNS cloudflare (high-we.com): xxx.xxx.174.178 extracted from local system.
        Feb 27 19:00:57	php-fpm	55946	/services_dyndns_edit.php: Dynamic DNS (high-web.com): running get_failover_interface for wan. found pppoe3
        Feb 27 19:00:57	php-fpm	55946	/services_dyndns_edit.php: Dynamic DNS cloudflare (high-we.com): _update() starting.
        Feb 27 19:01:02	php-fpm	55946	/services_dyndns_edit.php: Dynamic DNS cloudflare (high-we.com): _checkStatus() starting.
        Feb 27 19:01:02	php-fpm	55946	/services_dyndns_edit.php: phpDynDNS (high-web): (Error) Zone or Host ID was not found, check the hostname.
        

        when i used hostname field high-we –---domain field com

        Thank you.

        1 Reply Last reply Reply Quote 0
        • J
          jimp Rebel Alliance Developer Netgate
          last edited by Feb 28, 2017, 7:52 PM

          Can someone with Cloudflare and one of these records try applying this patch with the System Patches package?

          http://atxfiles.pfsense.org/jimp/patches/cfddns-at.diff

          That lets the GUI accept an @ for the hostname which should let it work.

          If that does work and the records update properly and operate as expected, I'll commit the change, along with changing the upgrade code so that if the hostname ended up blank it would get pre-filled with @.

          If this doesn't work, then there is still another change I can try, but again I need someone who has Cloudflare with an appropriate record to test it.

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • B
            borgotech
            last edited by Mar 1, 2017, 12:27 PM

            I 'l try in a few hours, i'm at work now. Thank you.

            1 Reply Last reply Reply Quote 0
            • B
              borgotech
              last edited by Mar 1, 2017, 4:31 PM Mar 1, 2017, 4:22 PM

              It doesnt work, i patched the file /src/usr/local/www/services_dyndns_edit.php "manualy" …in the diff file the line from where start the code is line 111 but on my file it start at line  149```
              /diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
              index acff97f..07f1636 100644
              --- a/src/usr/local/www/services_dyndns_edit.php
              +++ b/src/usr/local/www/services_dyndns_edit.php
              @@ -111,6 +111,8 @@ if ($_POST['save'] || $_POST['force']) {
              /* Namecheap can have a @. and . in hostname /
              if ($pconfig['type'] == "namecheap" && ($_POST['host'] == '
              .' || $_POST['host'] == '
              ' || $_POST['host'] == '@.' || $_POST['host'] == '@')) {
              $host_to_check = $_POST['domainname'];

              •   } elseif ((($pconfig['type'] == "cloudflare") || ($pconfig['type'] == "cloudflare-v6")) && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
                
              •   	$host_to_check = $_POST['domainname'];
                  } else {
                  	$host_to_check = $_POST['host'];/
                
              The good thing is .. now "@" is accepted but it doesnt work. This is my log file:
              

              Mar 1 18:06:17 php-fpm 35954 /services_dyndns_edit.php: Dynamic DNS: updatedns() starting
              Mar 1 18:06:17 php-fpm 35954 /services_dyndns_edit.php: Dynamic DNS cloudflare (@.high-we.com): xxx.xxx.xxx.98 extracted from local system.
              Mar 1 18:06:17 php-fpm 35954 /services_dyndns_edit.php: Dynamic DNS (@.high-we.com): running get_failover_interface for wan. found pppoe3
              Mar 1 18:06:17 php-fpm 35954 /services_dyndns_edit.php: Dynamic DNS cloudflare (@.high-we.com): _update() starting.
              Mar 1 18:06:22 php-fpm 35954 /services_dyndns_edit.php: Dynamic DNS cloudflare (@.high-we.com): _checkStatus() starting.
              Mar 1 18:06:22 php-fpm 35954 /services_dyndns_edit.php: phpDynDNS (@): (Error) Zone or Host ID was not found, check the hostname

              
              Best Regards
              1 Reply Last reply Reply Quote 0
              • J
                jimp Rebel Alliance Developer Netgate
                last edited by Mar 1, 2017, 4:28 PM

                OK, I'll have to change that to sub @ or @. for "" (nothing) in the backend when that happens. I'll work up a different patch later today.

                Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                Need help fast? Netgate Global Support!

                Do not Chat/PM for help!

                1 Reply Last reply Reply Quote 0
                • C
                  choochoo
                  last edited by Mar 2, 2017, 10:54 PM

                  If you need someone else with Cloudflare and dynamic DNS, I can try to provide assistance where needed also.

                  1 Reply Last reply Reply Quote 0
                  • B
                    borgotech
                    last edited by Mar 6, 2017, 6:10 AM

                    @jimp:

                    OK, I'll have to change that to sub @ or @. for "" (nothing) in the backend when that happens. I'll work up a different patch later today.

                    Any new? about fix ..

                    Thank you.
                    Best Regards

                    1 Reply Last reply Reply Quote 0
                    • J
                      jimp Rebel Alliance Developer Netgate
                      last edited by Mar 6, 2017, 2:08 PM

                      Revert my previous patch and try this one: http://atxfiles.pfsense.org/jimp/patches/cfddns-at-trim.diff

                      Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                      Need help fast? Netgate Global Support!

                      Do not Chat/PM for help!

                      1 Reply Last reply Reply Quote 0
                      • B
                        borgotech
                        last edited by Mar 6, 2017, 4:24 PM Mar 6, 2017, 4:14 PM

                        @jimp:

                        Can someone with Cloudflare and one of these records try applying this patch with the System Patches package?

                        http://atxfiles.pfsense.org/jimp/patches/cfddns-at.diff

                        That lets the GUI accept an @ for the hostname which should let it work.

                        If that does work and the records update properly and operate as expected, I'll commit the change, along with changing the upgrade code so that if the hostname ended up blank it would get pre-filled with @.

                        If this doesn't work, then there is still another change I can try, but again I need someone who has Cloudflare with an appropriate record to test it.

                        Old patch:

                        diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
                        index acff97f..07f1636 100644
                        --- a/src/usr/local/www/services_dyndns_edit.php
                        +++ b/src/usr/local/www/services_dyndns_edit.php
                        @@ -111,6 +111,8 @@ if ($_POST['save'] || $_POST['force']) {
                         		/* Namecheap can have a @. and *. in hostname */
                         		if ($pconfig['type'] == "namecheap" && ($_POST['host'] == '*.' || $_POST['host'] == '*' || $_POST['host'] == '@.' || $_POST['host'] == '@')) {
                         			$host_to_check = $_POST['domainname'];
                        +		} elseif ((($pconfig['type'] == "cloudflare") || ($pconfig['type'] == "cloudflare-v6")) && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
                        +			$host_to_check = $_POST['domainname'];
                         		} else {
                         			$host_to_check = $_POST['host'];
                        

                        @jimp:

                        Revert my previous patch and try this one: http://atxfiles.pfsense.org/jimp/patches/cfddns-at-trim.diff

                        This  patch is the same with previous patch :)
                        New patch:```
                        diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php
                        index acff97f..07f1636 100644
                        --- a/src/usr/local/www/services_dyndns_edit.php
                        +++ b/src/usr/local/www/services_dyndns_edit.php
                        @@ -111,6 +111,8 @@ if ($_POST['save'] || $_POST['force']) {
                        /* Namecheap can have a @. and . in hostname /
                        if ($pconfig['type'] == "namecheap" && ($_POST['host'] == '
                        .' || $_POST['host'] == '
                        ' || $_POST['host'] == '@.' || $_POST['host'] == '@')) {
                        $host_to_check = $_POST['domainname'];

                        •   } elseif ((($pconfig['type'] == "cloudflare") || ($pconfig['type'] == "cloudflare-v6")) && ($_POST['host'] == '@.' || $_POST['host'] == '@')) {
                          
                        •   	$host_to_check = $_POST['domainname'];
                            } else {
                            	$host_to_check = $_POST['host'];
                          
                        1 Reply Last reply Reply Quote 0
                        • J
                          jimp Rebel Alliance Developer Netgate
                          last edited by Mar 6, 2017, 4:23 PM

                          Well, hmm. It wasn't before I copied it. Let me make it again.

                          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                          Need help fast? Netgate Global Support!

                          Do not Chat/PM for help!

                          1 Reply Last reply Reply Quote 0
                          • J
                            jimp Rebel Alliance Developer Netgate
                            last edited by Mar 6, 2017, 4:24 PM

                            Fetch it again, should be the correct one now.

                            Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                            Need help fast? Netgate Global Support!

                            Do not Chat/PM for help!

                            1 Reply Last reply Reply Quote 0
                            • B
                              borgotech
                              last edited by Mar 6, 2017, 4:41 PM

                              Now its ok with the file.. i'll try the patch in a about 15 minutes..

                              1 Reply Last reply Reply Quote 0
                              • C
                                choochoo
                                last edited by Mar 6, 2017, 4:43 PM

                                I can confirm that the new patch that jimp provided is now working with Cloudflare DDNS. Thank you!

                                1 Reply Last reply Reply Quote 0
                                • B
                                  borgotech
                                  last edited by Mar 6, 2017, 5:22 PM

                                  Yes … its working now!!! Thank You very much!!

                                  1 Reply Last reply Reply Quote 0
                                  • J
                                    jimp Rebel Alliance Developer Netgate
                                    last edited by Mar 6, 2017, 5:48 PM

                                    I created https://redmine.pfsense.org/issues/7357 for this issue and pushed that fix. It will be in the next new snapshots and whatever release we put out next.

                                    Thanks for testing!

                                    Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

                                    Need help fast? Netgate Global Support!

                                    Do not Chat/PM for help!

                                    1 Reply Last reply Reply Quote 0
                                    • Z
                                      zuperjotmeil
                                      last edited by Mar 8, 2017, 7:05 PM Mar 8, 2017, 7:00 PM

                                      I have aplied your path and it solve the GUI problem. I could now put @ in host and save the DynDNS.

                                      But I am getting this in the log (I have changed real domain with "domain.demo"):

                                      Mar 8 15:46:27 php-fpm 92633 /services_dyndns_edit.php: phpDynDNS (@): UNKNOWN ERROR - Invalid request headers
                                      Mar 8 15:46:27 php-fpm 92633 /services_dyndns_edit.php: phpDynDNS (@): PAYLOAD: {"success":false,"errors":[{"code":6003,"message":"Invalid request headers","error_chain":[{"code":6103,"message":"Invalid format for X-Auth-Key header"}]}],"messages":[],"result":null}
                                      Mar 8 15:46:27 php-fpm 92633 /services_dyndns_edit.php: Dynamic DNS cloudflare (domain.demo): _checkStatus() starting.
                                      Mar 8 15:46:26 php-fpm 92633 /services_dyndns_edit.php: Dynamic DNS cloudflare (@.domain.demo): _update() starting.
                                      Mar 8 15:46:26 php-fpm 92633 /services_dyndns_edit.php: Dynamic DNS (@.domain.demo): running get_failover_interface for wan. found vmx0
                                      Mar 8 15:46:26 php-fpm 92633 /services_dyndns_edit.php: Dynamic DNS cloudflare (@.domain.demo): xxx.xxx.xxx.xxx extracted from local system.
                                      Mar 8 15:46:26 php-fpm 92633 /services_dyndns_edit.php: Dynamic DNS: updatedns() starting

                                      I am on:

                                      2.3.3-RELEASE (amd64)
                                      built on Thu Feb 16 06:59:53 CST 2017
                                      FreeBSD 10.3-RELEASE-p16

                                      1 Reply Last reply Reply Quote 0
                                      • Z
                                        zuperjotmeil
                                        last edited by Mar 8, 2017, 7:28 PM

                                        OK… my bad.

                                        Have to put Global API key as password, do not put your account password as password.

                                        User = user
                                        Password = Global API Key

                                        Works great... Thanks  :)

                                        1 Reply Last reply Reply Quote 0
                                        • O
                                          overcookedTOFU
                                          last edited by Mar 8, 2017, 11:04 PM Mar 8, 2017, 7:51 PM

                                          I'm on the latest release (2.4.0.b.20170308.0906) and I'm having a related issue or perhaps a regression.  (I think.)

                                          I'm updating a domain with the wildcard checkbox set.  The domain to be updated is *.subdomain.domain.com.

                                          I have confirmed that I am able to set the IP directly using curl and the cloudflare api.  Via the pfsense updater, the update fails and I get the following in the log.

                                          Mar 8 12:31:38 php-fpm 92474 /services_dyndns_edit.php: phpDynDNS (home): (Error) Zone or Host ID was not found, check the hostname.
                                          Mar 8 12:31:38 php-fpm 92474 /services_dyndns_edit.php: Dynamic DNS cloudflare (subdomain.domain.com): _checkStatus() starting.
                                          Mar 8 12:31:37 php-fpm 92474 /services_dyndns_edit.php: Dynamic DNS cloudflare (subdomain.domain.com): _update() starting.
                                          Mar 8 12:31:37 php-fpm 92474 /services_dyndns_edit.php: DynDns (subdomain.domain.com): Dynamic Dns: cacheIP != wan_ip. Updating. Cached IP: 0.0.0.0 WAN IP: xxx.xxx.xxx.xxx Initial update.

                                          Thanks!

                                          Update: I was able to successfully update a non-wildcard domain.  So, looks like whatever causes this issue is related to wildcard updates alone.

                                          1 Reply Last reply Reply Quote 0
                                          16 out of 28
                                          • First post
                                            26/28
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received