Skip to content

DNSExit: Updater breaks when provided with a zone and a non-identical hostname (bug) #673

@jortkoopmans

Description

@jortkoopmans

Description

When a configuration is provided with a zone and a hostname that is not identical to the zone, the updater fails. This issue was introduced with the implementation of the dnsexit provider, due to a misunderstanding of how the dnsexit API expects updates for 'subdomains'. This bug has been confirmed via the report here: opnsense/plugins

Steps to reproduce

  1. Provide a configuration with a zone and a hostname that is not identical to the zone.
  2. Run the updater.

Expected behavior

The updater should produce the following JSON call for host host1.myroot.publicvm.com on zone myroot.publicvm.com:

{
"domain":"myroot.publicvm.com",
"apikey":"myApiKey"
"update":
  [{
    "ttl":5,
    "type":"A",
    "content":"1.2.3.4",
     "name":"host1"
   }]
}

Actual behavior

Currently, the name field is identical to the full hostname, which does not work.
Note that for calls with identical name and zone, this does work, as does an empty name with a zone that contains a root hostname (i.e. myroot.publicvm.com)

Proposed solution

The issue can be fixed by:

  • Only providing the 'hostname' part on the name field in the update block, by trimming it from the zone (if provided).
  • Ensuring that this fix does not break other use cases (simple hostname only, without zone, hostname and zone being equal). Also handling ipv4 and ipv6 which must be done in a single call.

I will propose a solution shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions