Project

General

Profile

Actions

Bug #6566

closed

Cloudflare DnyDNS Update with subdomains

Added by Euan Kerr about 9 years ago. Updated about 6 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
Dynamic DNS
Target version:
-
Start date:
06/30/2016
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
All
Affected Architecture:
All

Description

If a host such as ip.example.co.uk is used for the cloudflare dynamic dns update the zone_id will fail to be returned.

I believe this is due to the following code from src/etc/inc/dyndns.class:

$dnsHost = str_replace(' ', '', $this->_dnsHost);
$host_names = explode(".", $dnsHost);
$bottom_host_name = $host_names[count($host_names)-2] . "." . $host_names[count($host_names)-1];

as $bottom_host_name would end up as "co.uk".

Something like this:

$dnsHost = str_replace(' ', '', $this->_dnsHost);
$host_names = explode(".", $dnsHost);
if (count($host_names) > 3) {
$bottom_host_name = $host_names[count($host_names)-3] . "." . $host_names[count($host_names)-2] . "." . $host_names[count($host_names)-1];
} else {
$bottom_host_name = $host_names[count($host_names)-2] . "." . $host_names[count($host_names)-1];
}

would check if the hostname contains more than three parts and would correctly retrieve the zone_id from cloudflare - I've tested it with ip.example.co.uk but my php isn't great so someone might want to improve it.

Actions

Also available in: Atom PDF