diff --git a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml
index 3ada63a84..8de2f381b 100644
--- a/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml
+++ b/dns/ddclient/src/opnsense/mvc/app/controllers/OPNsense/DynDNS/forms/dialogAccount.xml
@@ -30,6 +30,7 @@
DynDNS Server hostname or uri to use (depending on the protocol).
When a URI is provided, the tag __MYIP__ will be replaced with the current detected address for this service
and __HOSTNAME__ will contain the (comma separated) list of hostnames provided.
+ If the current address is an IPv6 the tag __IPV6PREFIX__ will be replaced with the /64 prefix of the current address.
diff --git a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py
index e93d0e5ab..46331d6d9 100755
--- a/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py
+++ b/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/dyndns2.py
@@ -23,6 +23,7 @@
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
"""
+import ipaddress
import syslog
import requests
from requests.auth import HTTPBasicAuth
@@ -71,6 +72,8 @@ class DynDNS2(BaseAccount):
url = self.settings.get('server')
url = url.replace('__MYIP__', self.current_address)
url = url.replace('__HOSTNAME__', self.settings.get('hostnames'))
+ if self.current_address.find(':') > 0:
+ url = url.replace('__IPV6PREFIX__', str(ipaddress.ip_network("%s/64" % self.current_address, strict=False)))
req = requests.request(
method=protocol,
url=url,