Ddns cloudflare script not able to handle router.home.example.com hostname


I post this here as I do not find a better place to post this question.

I have my domain (example.com) DNS service with cloudlfare. And I'm using the home.example.com subdomain for all the hosts at home. So my router FQDN is router.home.example.com, and my nas is then nas.home.example.com etc etc.

in order to have my router accessible from the internet I would like to use the ddns cloudlfare scripts (https://github.com/openwrt/packages/tree/master/net/ddns-scripts).

I have entered the details correctly as far as I can tell via the Luci screens, and in the ddns logs I also see that the script is able to query the cloudflare API to get the correct rec_id for the router.home.example.com dns A record.

the following https call is made to cloudflare:
https://www.cloudflare.com/api_json.html? a=rec_load_all& tkn=1234567890abcdef1234567890abcdef& email=email@example.com& z=example.com
and I see the correct details in the logs:

rec_id '1234567890' detected for host/domain 'router.home.example.com'

so far so good ...

then the update https call is created .. and there things go wrong:

https://www.cloudflare.com/api_json.html? a=rec_edit& tkn=1234567890abcdef1234567890abcdef& id=1234567890& email=email@example.com& z=example.com& type=A& name=router& content= service_mode=0& ttl=1
so instead of setting the name variable to 'router.home' .. the script sets it to just 'router'

When looking into the scripts I see that in the first call the cloudflare the script is using the FQDN that you configured (router.home.example.com) to find the correct rec_id from the JSON output and it is using the variable __DOMAIN as the zone details (see line 67 on this page : https://github.com/openwrt/packages/blob/master/net/ddns-scripts/files/update_cloudflare_com.sh#L67)
(sorry .. new user .. so limited number of links allowed)

so far so good again ..

in the update URL it is using the __SUBDOM variable in the 'name' field of the update so aparently that is set incorrect.

both the __DOMAIN and __SUBDOM variables are populated by using the split_FQDN function from here

and there I see nothing really wrong with how it gets split .. so why is the '__SUBDOM' variable (parameter $4 in the split_FQDN function) not populated with router.home?

any help would be appreciated

Kees D.

Sorry, I don't have any info on this report. Moving it to the "Installing and Using LEDE" category.

Please use github to report issues with ddns-scripts

okee .... issue is at:

will continue there .. the maintainer is already looking into it ..

for completness ... I was able to find the problem my self. There was a missing underscore in the split_FQDN in the version of the ddns scripts that was released with Chaos Calmer. You can find my explaination in the github issue.

please reference https://forum.openwrt.org/viewtopic.php?id=68813

The correct configuration for "option domain" differ from the known default:
default: host(dot)subdom(dot)yourdomain(dot)TLD
required: host(dot)subdom(at)yourdomain(dot)TLD
example: option domain "host.subdom@yourdomain.tld"

To update the domain record only configure "option domain" as before (without @ sign):
example: option domain "yourdomain.tld"