OPNsense Forum

English Forums => 23.7 Legacy Series => Topic started by: muchacha_grande on July 24, 2023, 12:26:49 am

Title: Can new DDNS plugin handle custom URLs ?
Post by: muchacha_grande on July 24, 2023, 12:26:49 am
Hi, as I read that old DDNS plugin will not exists anymore, I'm preparing to upgrade to the new one beforehand.
I'm using many custom URLs to update cPanel dynamic records.
Does the new plugin support custom URLs ?
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: bunchofreeds on July 25, 2023, 10:18:46 pm
I recently got os-ddclient running against Cloudflare using an API token.

Not sure about your request about custom URL's though, but there is an option in the client called 'custom' for the Dynamic DNS provider?

What do you mean by custom URL's exactly?
Maybe a couple of examples to help others help you.

There is also an option to add multiple hostnames. This only 'appears' to work for me if I choose to use the ddclient backend it seems. This is an option in the client. But with this I don't see any update information in the GUI, it only shows success in the logs. To get around this I choose the OPNsense backend and split my TLD's into separate configurations. Pretty easy because you can clone them.
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: muchacha_grande on July 26, 2023, 05:28:21 pm
Hi bunchofreeds, thank you for your answer.

By custom URLs I refer to the URL that cPanel requires to update a certain DNS "A" record.
When I create a dynamic DNS record under cPanel, it provides a URL to update it.

This is an example:
https://router.mysite.com:2083/cpanelwebcall/qcrbkttwhpfefyairvzshjeorzpuqqzm
No password needed.
If the call succeeds you obtain a response like "ipv4: %IP%"

My question is that if the new plugin supports calling a manual entered URL like the one above.
The original plugin allows to select 'custom' in the provider combo and allows to enter an arbitrary URL. Also, it allows to enter a response string with the IP variable %IP%, so the plugin can evaluate if the call succeeded or not.

Thank you again and cheers
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: franco on July 27, 2023, 10:13:08 am
Feature will be added in a bit, PR exists https://github.com/opnsense/plugins/pull/3511 but Ad already said he would look into it in order to find a simple solution for the custom bit.


Cheers,
Franco
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: muchacha_grande on July 28, 2023, 01:32:15 pm
Thank you Franco
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: monkeyclass on July 31, 2023, 03:53:46 pm
Feature will be added in a bit, PR exists https://github.com/opnsense/plugins/pull/3511 but Ad already said he would look into it in order to find a simple solution for the custom bit.


Cheers,
Franco

Happy to see you are basing an implementation on my PR! It's a feature I really need myself before utilizing the new ddns plugin so very happy to see movement on it.
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: henniee on August 15, 2023, 04:44:29 pm
I think I'm too stupid for the new "post" implementation:

Code: [Select]
2023-08-15T16:39:32 Notice ddclient FAILED: updating  xy.me2ip.com: Could not connect to https://ipv4.api.hosting.ionos.com/dns/v1/dyndns?q=0293840928348asjhhjasdjnbkaSJKASD().
2023-08-15T16:39:32 Notice ddclient WARNING: cannot connect to https:443 socket: hostname verification failed hostname verification failed
2023-08-15T16:39:31 Notice ddclient CONNECT: https:
2023-08-15T16:39:31 Notice ddclient UPDATE: updating xy.me2ip.com
2023-08-15T16:39:31 Notice ddclient INFO: setting IPv4 address to 93.222.141.22 forxy.me2ip.com
2023-08-15T16:39:31 Notice ddclient WARNING: 'if-skip' is deprecated and does nothing for IPv4
2023-08-15T16:39:31 Notice ddclient WARNING: file /usr/local/etc/ddclient.conf, line 12: Invalid Value for keyword 'protocol' = 'post'

can anybody help me pls?

WARNING: cannot connect to https:443 socket: hostname verification failed hostname verification failed
???
Invalid Value for keyword 'protocol' = 'post'
???
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: TorbenS on August 16, 2023, 04:17:20 pm
I'm getting the same error: "Invalid Value for keyword 'protocol' = 'post'"

 :-\

Remember the good old ddns...
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: franco on August 16, 2023, 04:22:37 pm
Somehow this is funny because ddclient is not supposed to even this... because the OPNsense backend is used...

2023-08-15T16:39:31   Notice   ddclient   WARNING: file /usr/local/etc/ddclient.conf, line 12: Invalid Value for keyword 'protocol' = 'post'


Cheers,
Franco
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: henniee on August 16, 2023, 04:50:33 pm
lol - set the Backend to OPNsense in General Settings (default is ddclinet) - will try it again ;) thy!
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: henniee on August 16, 2023, 05:20:56 pm
not it shows:
[400 - {"message":"Invalid API key format."}]

if i do the post manually:
curl +X https://ipv4.api.hosting.ionos.com/dns/v1/dyndns?q=MJHGAFJAHsd67tf<xchgfGHFHJGYXCvbyxzg76sadhgfvgxc7yx6c75gyhxcg

(code is example!)
it works...

FAQ from 1u/1/ Ionos:
https://www.ionos.de/hilfe/domains/ip-adresse-konfigurieren/dynamisches-dns-ddns-einrichten-bei-company-name/?utm_source=search&utm_medium=standalone&utm_term=api&utm_campaign=all
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: thowe on August 16, 2023, 10:18:41 pm
I should also be able to make a GET-request to a custom URL with the new DynDNS plugin to be able to set the NIC addresses of the WAN interfaces at OpenDNS:
https://updates.opendns.com/nic/update?hostname=WAN1-Provider1

and

https://updates.opendns.com/nic/update?hostname=WAN2-Provider2

In the old DynDNS plugin this was easy. As soon as this works with the new DynDNS plugin, I can update the OPNsense. Before that it does not work. Unless I make a cron job that sends the GET request... But I would prefer the DynDNS plugin, because it is more explicit and better integrated in config backups, etc.

Edit:
Wait: I just realized that this Merge request is about a custom POST-request. So does this mean, that a custom GET-request is already configurable?
Title: Re: Can new DDNS plugin handle custom URLs ?
Post by: franco on August 17, 2023, 12:45:34 pm
https://github.com/opnsense/plugins/pull/3523