Dynamic DNS Cloudflare v4 API issues with pfSense
-
Anyone else experiencing this? Thanks.
It looks like we are using v4 API for CloudFlare: https://github.com/pfsense/pfsense/blob/473f37a9f4b034cd245e9601005a5e28b97349f1/src/etc/inc/dyndns.class
However, it does not work properly.
Here is the verbose error messages I get in my system log (removed my IP, hash and domain for privacy):
Dec 5 10:33:59 php-fpm 73659 /services_dyndns_edit.php: phpDynDNS (pfv4.EXAMPLE.com): UNKNOWN ERROR - Dec 5 10:33:59 php-fpm 73659 /services_dyndns_edit.php: phpDynDNS (pfv4.EXAMPLE.com): PAYLOAD: {"result":[{"id":"888888888FAKEDHASH*******","name":"EXAMPLE.com","status":"active","paused":false,"type":"full","development_mode":-218008,"name_servers":["cass.ns.cloudflare.com","ken.ns.cloudflare.com"],"original_name_servers":["ns1.he.net","ns2.he.net","ns3.he.net","ns4.he.net","ns5.he.net"],"original_registrar":null,"original_dnshost":null,"modified_on":"2016-12-05T15:07:37.851699Z","created_on":"2016-07-22T17:40:33.036901Z","meta":{"step":4,"wildcard_proxiable":false,"custom_certificate_quota":0,"page_rule_quota":3,"phishing_detected":false,"multiple_railguns_allowed":false},"owner":{"type":"user","id":"FAKEDHASH","email":"myemail@mydomain.com"},"permissions":["#analytics:read","#billing:edit","#billing:read","#cache_purge:edit","#dns_records:edit","#dns_records:read","#lb:edit","#lb:read","#logs:read","#organization:edit","#organization:read","#ssl:edit","#ssl:read","#waf: Dec 5 10:33:59 php-fpm 73659 /services_dyndns_edit.php: Dynamic DNS cloudflare (pfv4.EXAMPLE.com): _checkStatus() starting. Dec 5 10:33:58 php-fpm 73659 /services_dyndns_edit.php: Dynamic DNS cloudflare (pfv4.EXAMPLE.com): _update() starting. Dec 5 10:33:58 php-fpm 73659 /services_dyndns_edit.php: Dynamic DNS (pfv4.EXAMPLE.com): running get_failover_interface for wan. found igb0 Dec 5 10:33:58 php-fpm 73659 /services_dyndns_edit.php: Dynamic DNS cloudflare (pfv4.EXAMPLE.com): 127.0.0.1 extracted from local system. Dec 5 10:33:58 php-fpm 73659 /services_dyndns_edit.php: Dynamic DNS: updatedns() starting[/code]
-
All,
It seems like the dyndns.class on RELENG_2_3 has not been updated correctly to the latest branch which is causing issues for CloudFlare Dynamic DNS updating
pfSense Stable: https://raw.githubusercontent.com/pfsense/pfsense/RELENG_2_3_2/src/etc/inc/dyndns.class
pfSense 2.3.3: https://raw.githubusercontent.com/pfsense/pfsense/RELENG_2_3/src/etc/inc/dyndns.class
Can we please get these branches updated so that Dynamic DNS works for pfSense 2.3.3?
-
Any update on this?
2.3.3-dev has the same problem with dyndns.org
Myk
-
:(
Still not working.
2.3.3-RELEASE (amd64)
built on Thu Feb 16 06:59:53 CST 2017
FreeBSD 10.3-RELEASE-p16Please fix it.
-
Someone that actually has access to Cloudflare is going to have to step up and help. We do not have any Cloudflare accounts here. We added several fixes for Cloudflare to 2.4 and 2.3.3 that sat for four months with no feedback.
We need more information than "not working". Show us settings you are using, set the dyndns entry to verbose log output and get the logs, and so on.
-
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.
-
same for me, not working and cant update A record, which i think where the issue is.
-
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.
-
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.
-
I 'l try in a few hours, i'm at work now. Thank you.
-
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 hostnameBest Regards
-
-
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.
-
If you need someone else with Cloudflare and dynamic DNS, I can try to provide assistance where needed also.
-
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 -
Revert my previous patch and try this one: http://atxfiles.pfsense.org/jimp/patches/cfddns-at-trim.diff
-
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'];
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'];
-
-
Well, hmm. It wasn't before I copied it. Let me make it again.
-
Fetch it again, should be the correct one now.
-
Now its ok with the file.. i'll try the patch in a about 15 minutes..
-
I can confirm that the new patch that jimp provided is now working with Cloudflare DDNS. Thank you!