Hi, I want to report a bug in the DDNS config generated for Cloudflare. Currently, if you configure DDNS with Cloudflare, you have to provide a hostname with the following format <record>@<zone>, which creates a DDNS config like the following:
config ddns 'global'
....
config service
option enabled '1'
option service_name 'cloudflare.com-v4'
option domain 'sub@domain.example'
option username 'Bearer'
option password 'MyUltraSecureToken'
option use_https '1'
option lookup_host 'sub@domain.example'
option interface 'wan'
option ip_network 'wan'
option ip_source 'web'
option ip_url 'https://manage.alta.inc/api/ip'
option force_ipversion '1'
However, if you look closely, the “lookup_host” also includes the @ symbol, which causes problems in the DNS query performed to resolve the current IP addr configured in Cloudflare, generating the following logs:
WARN : Get registered/public IP for 'sub@domain.example' failed - retry 3/0 in 60 seconds
: #> /usr/bin/drill -V0 -4 -u sub@domain.example A >/var/run/ddns/cfg025996.dat 2>/var/run/ddns/cfg025996.err
WARN : NO valid IP found
WARN : Get registered/public IP for 'sub@domain.example' failed - retry 4/0 in 60 seconds
: #> /usr/bin/drill -V0 -4 -u sub@domain.example A >/var/run/ddns/cfg025996.dat 2>/var/run/ddns/cfg025996.err
WARN : NO valid IP found
It’s pretty clear that the error is due to the lookup_host field , which is incompatible with the drill command, which expects a traditional hostname; if you modify the /etc/config/ddns file with the correct hostname for the field, the update works as expected.
Hopefully, this will help others and get fixed in the upcoming firmware.