OPNsense Forum

English Forums => General Discussion => Topic started by: jonf on February 12, 2021, 11:28:37 am

Title: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: jonf on February 12, 2021, 11:28:37 am
Not sure if this is the right part of the forum to ask but here we go...

I recently signed up to NoIP's dynamic DNS service so I could link it up to my OPNsense box.  I notice that OPNsense currently supports linking your IPv4 address to your NoIP hostname, but not the IPv6 address.  I don't know if NoIP's IPv6 service wasn't available at the time NoIP was initially added to the list of providers, or if it's been tested before but not included because of some issues.

In case it's the former I wanted to ask if it could be added, so I guess this thread is sort of a feature request.  If it helps the developers here's a link I found to the details required for integrating their update service into 3rd party products, including the IPv6 related stuff:

https://www.noip.com/integrate/request

I tested this with my own hostname by resetting my broadband connection to get new IP addresses (I have both v4 and v6 enabled), then I copied/pasted their HTTPS update request link (modified with my account details, hostname, and the IPv6 address to be linked) into my browser to see if it updated my hostname's IP address.  It gave a message that said "good <newipv4address>,<newipv6address>".  I then logged into my NoIP account and both the v4 and v6 addresses got updated (maybe because I have both running on my network).
Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: Greelan on February 12, 2021, 04:27:14 pm
The plugin is old, and the No-IP part was no doubt written long before it provided IPv6 support. Only a few providers are given IPv6 support in the plugin (https://github.com/opnsense/plugins/blob/master/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc).

Judging from this thread (https://github.com/opnsense/plugins/issues/1611#issuecomment-706129596) it seems unlikely that it will be updated any time soon.
Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: jonf on February 12, 2021, 04:38:50 pm
The plugin is old, and the No-IP part was no doubt written long before it provided IPv6 support. Only a few providers are given IPv6 support in the plugin (https://github.com/opnsense/plugins/blob/master/dns/dyndns/src/etc/inc/plugins.inc.d/dyndns/phpDynDNS.inc).

Judging from this thread (https://github.com/opnsense/plugins/issues/1611#issuecomment-706129596) it seems unlikely that it will be updated any time soon.

Blimey:

Code: [Select]
*  No-IP                       - Last Tested: 20 July 2008
I guess I can settle for manual IPv6 updates as and when needed... :-[
Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: Greelan on February 12, 2021, 04:45:56 pm
Or get your hands dirty with PHP lol
Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: Greelan on February 13, 2021, 12:09:51 am
Probably though a better long term solution is for the plugin to switch to using an actively maintained client like ddclient. There is a FreeBSD port for it: https://www.freshports.org/dns/ddclient. ddclient is meant to have IPv6 support. The plugin would then I imagine largely be just a frontend for configuring the required parameters
Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: jonf on February 13, 2021, 01:18:18 pm
OK I decided last night to experiment with creating a custom shell script which I could then schedule via cron.  I know the command I want to invoke, which I ran manually via a shell session:

Code: [Select]
curl "https://<username>:<password>@dynupdate.no-ip.com/nic/update?hostname=<hostname>&myipv6=<ipv6address>&myip=<ipv4address>"
I discovered that putting the URL inside double quotes updates both the v6 and v4 addresses, but without them it only updates the v4 address for some reason.  But if I try to put this into a script I get the following error from curl after running the script:

Code: [Select]
curl: (3) URL using bad/illegal format or missing URL
I tried "escaping the double quotes", as the Internet calls it, but I get the same error.  I even tried changing the shell that gets invoked after the shebang (I had it set to /bin/sh initially) - no difference.  Here's how the script currently looks:

Code: [Select]
#!/usr/local/sbin/opnsense-shell

IPV4=`curl https://ipv4.icanhazip.com/`
IPV6=`curl https://ipv6.icanhazip.com/`

curl \"https://<username>:<password>@dynupdate.no-ip.com/nic/update?hostname=<hostname>&myipv6=${IPV6}&myip=${IPV4}\"

Any ideas?
Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: marjohn56 on February 13, 2021, 07:11:21 pm
From windows curl it's this:


curl -u username:password "http://dynupdate.no-ip.com/nic/update?hostname=hostname.ddns.net&myip=xxx.xxx.xxx.xxx&myipv6=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx (http://dynupdate.no-ip.com/nic/update?hostname=hostname.ddns.net&myip=xxx.xxx.xxx.xxx&myipv6=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx)"


with FreeBSD this works


curl -u "username:password" "http://dynupdate.no-ip.com/nic/update?hostname=hostname.ddns.net&myip=xxx.xxx.xxx.xxx&myipv6=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx (http://dynupdate.no-ip.com/nic/update?hostname=hostname.ddns.net&myip=xxx.xxx.xxx.xxx&myipv6=xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx)"




Title: Re: Feature request (sort of): dynamic DNS - NoIP over IPv6?
Post by: jonf on February 14, 2021, 04:02:42 pm
I think I finally got it working (ran it twice in the OPNsense console to make sure)! Here's the final script I have:

Code: [Select]
#!/bin/sh

# just in case the other shell doesn't work: /usr/local/sbin/opnsense-shell

ipv6=`curl https://ipv6.icanhazip.com`

curl -X POST -u "<username>:<password>" https://dynupdate.no-ip.com/nic/update?hostname=<hostname> -d myipv6=${ipv6}

It would also have helped if I thought to check the file encoding before saving so many failed versions of my script - it was set to Windows, not Unix... :-[

Thanks to everyone who chipped in :).