plugins icon indicating copy to clipboard operation
plugins copied to clipboard

dns/ddclient: fix needed for dnsexit provider's json for hostnames updates

Open DiSHTiX opened this issue 1 year ago • 1 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 ddclient is using incorrect json command for hostname update only (eg.hostname.domain.publicvm.com) , when using updating the subdomain (domain.publicvm.com) it works fine because the correct 'domain' is referenced. publicvm.com is one of DNSExit's free domains.

ddclient: log file snippet modified using hostname.domain.publicvm.com and IP 1.1.1.100 which i'll continue to use for clarity

Notice | ddclient | FAILED: Server response: System Error - Fail to find UserID for hostname.domain.publicvm.com
Notice | ddclient | FAILED: System Error. Our system problem. May not be your problem. Contact our support if you got such error.
Notice | ddclient | INFO: Server Message: System Error - Fail to find UserID for hostname.domain.publicvm.com -- Server Details: no details received
Notice | ddclient | INFO: Status: error -- Message: System Error. Our system problem. May not be your problem. Contact our support if you got such error. 
Notice | ddclient | RECEIVE: {"code":6,"message":"System Error - Fail to find UserID for hostname.domain.publicvm.com"}
Notice | ddclient | SENDING: data="{\"update\":[{\"content\":\1.1.1.100\",\"name\":\"hostname.domain.publicvm.com\",\"ttl\":5,\"type\":\"A\"}],\"apikey\":\"xxxxxx\",\"domain\":\"hostname.domain.publicvm.com\"}" 

To Reproduce Steps to reproduce the behavior:

  1. Create an additional hostname within your domain on DNSExit
  2. Configure ddclient to update the hostname IP
  3. Save and click on update
  4. Check the ddclient log
  5. See error

Snippet of the JSON reference modified based on above example from dnsexit's API document for posting an update. 1. domain(current) 2. hostname

{
   "domain":"domain.publicvm.com",
   "update":{
      "type":"A",
      "name":"",             //name can be "domain.publicvm.com" instead (not required)
      "content":"1.1.1.100"  //content is the new IPv4 address of the domain
      "ttl":5                //ttl value is in minutes 480 = 6 hours
   }
}

{
   "domain":"domain.publicvm.com",
   "update":{
      "type":"A",
      "name":"hostname",     //hostname without domain
      "content":"1.1.1.100"  //content is the new IPv4 address of the domain
      "ttl":5                //ttl value is in minutes 480 = 6 hours
   }
}

DNS Exit Support issue confirmation:

From: DNS Exit Support 
Sent: Friday, December 15, 2023 at 11:48 PM
Subject: API issue: System Error - Fail to find UserID ::Free User

"domain\":\"hostname.domain.publicvm.com\"

Sure there is no domain hostname.domain.publicvm.com
That is hostname under domain domain.publicvm.com

Jack
DNS Exit

Environment OPNsense latest stable with ddclient

@fichtner

DiSHTiX avatar Dec 16 '23 21:12 DiSHTiX