plugins icon indicating copy to clipboard operation
plugins copied to clipboard

ddclient: netcup only supports one level subdomain

Open Sduniii opened this issue 9 months ago • 2 comments

Important notices Before you add a new report, we ask you kindly to acknowledge the following:

  • [x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
  • [x] I have searched the existing issues, open and closed, and I'm convinced that mine is new.
  • [x] The title contains the plugin to which this issue belongs

Describe the bug infoDnsZone failed with status error. response: {'serverrequestid': '', 'clientrequestid': '', 'action': '', 'status': 'error', 'statuscode': 4013, 'shortmessage': 'Validation Error.', 'longmessage': 'Value in field domainname does not match requirements of type: domainname. ', 'responsedata': ''}

(https://github.com/opnsense/plugins/blame/da53031f7fe8f4fe26511164780819d9d0b52d69/dns/ddclient/src/opnsense/scripts/ddclient/lib/account/netcup.py#L67) It is not possible to add a domain like *.subdomain.mydomain.com, for example.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'Service->Dynamic DNS->Settings'
  2. Click on 'Add'
  3. Enter a Hostname with multiple subdomains *.subdomain.mydomain.com
  4. See error in Log

Expected behavior DNS entry for "*.subdomain" should be updated to current ip.

Possible Fix

self.domain = self.settings['hostnames'].split('.', self.settings['hostnames'].count('.')-1)[-1]
self.hostname = self.settings['hostnames'].rsplit('.', 2)[0]

Environment OPNsense 24.1.6 (amd64).

Sduniii avatar May 06 '24 09:05 Sduniii

I think the core of this issue is same as i'm having. #3712 A ticket has just been raised

https://github.com/ddclient/ddclient/issues/673

DiSHTiX avatar May 22 '24 01:05 DiSHTiX

No, this not solved the problem. Here is a script for fixing after every update:

#!/bin/bash

sed -i '' "s/self\.hostname, self\.domain = self\.settings\['hostnames'\]\.split('\.', 1)/#self\.hostname, self\.domain = self\.settings\['hostnames'\]\.split('\.', 1)\\
            self\.domain = self\.settings\['hostnames'\]\.split('\.', self\.settings\['hostnames'\]\.count('\.')-1)\[-1]\\
            self\.hostname = self\.settings\['hostnames'\]\.rsplit('\.', 2)\[0]/g" /usr/local/opnsense/scripts/ddclient/lib/account/netcup.py

Sduniii avatar Sep 28 '24 14:09 Sduniii