Project

General

Profile

Bug #9362

rc.dyndns.update: Cloudflare DDNS with proxy enabled doesn't work at all

Added by Nico Schneider 7 months ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Dynamic DNS
Target version:
-
Start date:
03/03/2019
Due date:
% Done:

0%

Estimated time:
Affected Version:
Affected Architecture:

Description

When updating the DNS record via services_dyndns_edit.php it works normally, but when it tries to update it automatically (e.g. after the interface IP changes), it does not work and throws this error:

/rc.dyndns.update: phpDynDNS (@): PAYLOAD: {"success":false,"errors":[{"code":1004,"message":"DNS Validation Error","error_chain":[{"code":9003,"message":"Invalid 'proxied' value, must be a boolean"}]}],"messages":[],"result":null}

it seems like services_dyndns_edit.php sends the request the right way, however rc.dyndns.update doesnt.

History

#1 Updated by Berzerker Berzerker 4 months ago

Chiming in that this is broken for me as well, as described in the original description.

2.4.4-p2

#2 Updated by Arian K. 4 months ago

Berzerker Berzerker wrote:

Chiming in that this is broken for me as well, as described in the original description.

2.4.4-p2

exactly same problem ... 2.4.4-p3

#3 Updated by Nathan Hand about 2 months ago

Underlying problem is /etc/inc/dyndns.class line 799. The value of dnsProxied is passed directly to Cloudflare.

  $hostData = array(
    "content" => "{$this->_dnsIP}",
    "type" => "{$recordType}",
    "proxied" => $this->_dnsProxied,
    "name" => "{$this->_dnsHost}" 
  );

However $this->_dnsProxied is neither true nor false, it's an empty string. The mistake is in /etc/inc/services.inc line 1881

  $dnsProxied = $conf['proxied'],   

The value is taken from /conf/config.xml which is

  <proxied></proxied>

when true and missing when false. However the conf is taking the contents of the tag, not the existence of the tag. The fix is

--- services.inc.orig    2019-07-29 10:06:14.249341000 +1000
+++ services.inc    2019-07-29 10:31:42.415104000 +1000
@@ -1878,7 +1878,7 @@
         $dnsUser = $conf['username'],
         $dnsPass = $conf['password'],
         $dnsWildcard = $conf['wildcard'],
-        $dnsProxied = $conf['proxied'],
+        $dnsProxied = isset($conf['proxied']),
         $dnsMX = $conf['mx'],
         $dnsIf = "{$conf['interface']}",
         $dnsBackMX = NULL,

#4 Updated by Arian K. about 2 months ago

Nathan Hand wrote:

Underlying problem is /etc/inc/dyndns.class line 799. The value of dnsProxied is passed directly to Cloudflare.

[...]

However $this->_dnsProxied is neither true nor false, it's an empty string. The mistake is in /etc/inc/services.inc line 1881

[...]

The value is taken from /conf/config.xml which is

[...]

when true and missing when false. However the conf is taking the contents of the tag, not the existence of the tag. The fix is

[...]

Nathan Hand wrote:

Underlying problem is /etc/inc/dyndns.class line 799. The value of dnsProxied is passed directly to Cloudflare.

[...]

However $this->_dnsProxied is neither true nor false, it's an empty string. The mistake is in /etc/inc/services.inc line 1881

[...]

The value is taken from /conf/config.xml which is

[...]

when true and missing when false. However the conf is taking the contents of the tag, not the existence of the tag. The fix is

[...]

Can't believe it's finally solved ... Unlimited thanks to you Nathan ...

#5 Updated by Jim Pingle about 1 month ago

Can you submit that change as a pull request on github?

Thanks.

#6 Updated by Emmanuel Cardenas about 1 month ago

Nathan Hand wrote:

Underlying problem is /etc/inc/dyndns.class line 799. The value of dnsProxied is passed directly to Cloudflare.

[...]

However $this->_dnsProxied is neither true nor false, it's an empty string. The mistake is in /etc/inc/services.inc line 1881

[...]

The value is taken from /conf/config.xml which is

[...]

when true and missing when false. However the conf is taking the contents of the tag, not the existence of the tag. The fix is

[...]

Seriously was going crazy! Thanks so much, Nathan, changing the configuration worked immediately after a reboot. Can't believe after so much frustration and scouring of the internet, this was able to be fixed. Seriously a thousand thanks! :D

#7 Updated by Berzerker Berzerker about 1 month ago

Nathan Hand wrote:

Underlying problem is /etc/inc/dyndns.class line 799. The value of dnsProxied is passed directly to Cloudflare.

[...]

However $this->_dnsProxied is neither true nor false, it's an empty string. The mistake is in /etc/inc/services.inc line 1881

[...]

The value is taken from /conf/config.xml which is

[...]

when true and missing when false. However the conf is taking the contents of the tag, not the existence of the tag. The fix is

[...]

This fix does not work 100%. Changing this to the above causes the entries to be always set to proxied. The fact that the stock code works fine when manually updating vs an automatic update from an IP change leads me to believe the issue is not in the service itself, but the function that runs an update when the service is called.

Also available in: Atom PDF