ddns with multiple domains using Cloudflare

Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.)
Author Message
seedsca
DD-WRT Novice


Joined: 01 Sep 2023
Posts: 8

PostPosted: Fri Sep 01, 2023 0:55    Post subject: ddns with multiple domains using Cloudflare Reply with quote
• Current DD-WRT Firmware: DD-WRT v3.0-r51275 std (01/09/23)
• wrt3200acm

Using information from here:
https://wiki.dd-wrt.com/wiki/index.php/Multiple_DDNS_Accounts

I've gotten ddns to work with a single domain, with settings below.



However I can't seem to be able to get multiple ones updated. I've tried adding domain1.com -a domain2.com but then it thinks -a is an invalid host. If I just use a space between the domains, it does nothing at all...

Code:
In-a-dyn version 2.10.0 -- Dynamic DNS update client.
Startup delay: 30 sec ...
Failed resolving hostname -a: Name does not resolve
Update forced for alias -a, new IP# 1.2.3.4
HTTP 400: Cloudflare says our request was invalid. Possibly a malformed API token.
Fatal error in DDNS server response:
[400 Bad Request] {"result":null,"success":false,"errors":[{"code":1004,"message":"DNS Validation Error","error_chain":[{"code":9000,"message":"DNS name is invalid."


I know there are other ways to do this, but it would be nice to keep all the work "inhouse".

Thanks
Sponsor
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14249
Location: Texas, USA

PostPosted: Fri Sep 01, 2023 2:31    Post subject: Reply with quote
The latest commit on the source code for inadynv2 is 52714, the latest commit to DDNS.asp is 53045, and that is about as far as I'm going to dig to suggest updating to the current release and testing it, but also, that wiki is old and unmaintained:
Quote:
This page was last modified 07:26, 13 May 2010.


https://download1.dd-wrt.com/dd-wrtv2/downloads/betas/2023/08-27-2023-r53445/linksys-wrt3200acm/

_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
seedsca
DD-WRT Novice


Joined: 01 Sep 2023
Posts: 8

PostPosted: Sat Sep 02, 2023 2:17    Post subject: Reply with quote
Okay all updated to the latest and greatest, but still same issue. I'll dig into the code and see what I can find.
Per Yngve Berg
DD-WRT Guru


Joined: 13 Aug 2013
Posts: 6872
Location: Romerike, Norway

PostPosted: Sat Sep 02, 2023 7:08    Post subject: Reply with quote
Configure the other domains with a Cname that points to the first that are updated.
seedsca
DD-WRT Novice


Joined: 01 Sep 2023
Posts: 8

PostPosted: Sat Sep 02, 2023 16:58    Post subject: Reply with quote
Using DNS to handle this would be an option, but seems like a bit of a hack. Considering the functionality is there...

I seem to have managed to get two hosts updated by just putting them next to each other, no commas, no -a. sub1.domain.com sub2.domain.com

It didn't seem to be working as the Service Status never updated after saving and applying settings, but if I reboot the router, it does run correctly. We'll see if it updates later today.

In the /tmp/ddns/inadyn.conf file the hostname shows as {"sub1.domain.com", "sub2.domain.com"} so that seems correct per the inadyn docs.

Only issue I'm seeing now is that the proxied option is not available, so the Cloudflare orange cloud is not set.
seedsca
DD-WRT Novice


Joined: 01 Sep 2023
Posts: 8

PostPosted: Sat Sep 16, 2023 5:43    Post subject: Reply with quote
So for the time being I am able to get this to work and set the Orange Cloud (proxi) through the Administration -> Commands setting. Kill the inadyn process and then run again with custom inadyn.conf file.

Run this command on Firewall start:

Code:
kill $(pidof inadyn)
inadyn --cache-dir=/jffs/inadyn -e ddns_success --exec-mode=compat -f /jffs/inadyn/inadyn.conf -P /var/run/inadyn.pid -l notice -C -t 30


It's essentially the same file as the /tmp/ddns/inadyn/inadyn.com that can be setup through the GUI, but since we can't add multiple hostnames or enable the proxi setting we can use this in the conf file instead:

Code:
period = 600
forced-update = 86400
provider default@cloudflare.com {
username = "domain.com"
password = "api_token"
hostname = {"sub1.domain.com", "sub2.domain.com"}
ssl = true
checkip-command = "/sbin/service checkwanip main"
proxied = true
}
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Marvell MVEBU based Hardware (WRT1900AC etc.) All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum