Skip to content

[Bug]: Saving a zone or record causes ghost records in database #914

@prozzerg

Description

@prozzerg

Describe the problem

When I press the Save button on the "edit zone" with a zone that contans a dot, it causes new records to appear in the database with NULL as type, content, ttl, prio and ordername.
For example: the zone example.com got an A recod named ntp1.services.example.com a empty record named services.example.com is created in the database.
This also happens if you add a record, for example adding ntp1.services.example.com.

For normal use of PowerAdmin and PowerDNS, these 'ghost' records doesnt seem to be a problem but for the API in PowerAdmin it causes the /v2/zones/{id}/records endpoint to break. I suppose that more things in the API can have problems with this but this is what I've run into so far.

Steps to reproduce

  1. Enter the edit view of a zone containing a record with dots in the record
  2. Press Save

Or:

  1. Press Add Record in the Edit zone view and enter a record with a dot in the name (ex. ntp1.services.example.com)
  2. Press Add record

Poweradmin version

master

Database

PostgreSQL

Additional information (optional)

Database output for the records created:
pdns=# select * from records where type is NULL;
id | domain_id | name | type | content | ttl | prio | disabled | ordername | auth
-------+-----------+------------------------------+------+---------+-----+------+----------+-----------+------
12497 | 24 | _domainkey.avtal.testzone.se | | | | | f | | t
12498 | 24 | _tcp.testzone.se | | | | | f | | t
12499 | 24 | services.testzone.se | | | | | f | | t
12500 | 24 | _tls.testzone.se | | | | | f | | t
(4 rows)

The records that I suppose are the source of the new ghost records:
id | domain_id | name | type | content | ttl | prio | disabled | ordername | auth
-------+-----------+----------------------------------------+-------+---------------------------------------------------------------------------+-------+------+----------+-----------+------
9760 | 24 | _sipfederationtls._tcp.testzone.se | SRV | 100 5061 sipfed.online.lync.com | 3600 | 1 | f | | t
9762 | 24 | _sip._tls.testzone.se | SRV | 100 443 sipdir.online.lync.com | 3600 | 1 | f | | t
9778 | 24 | ntp1.services.testzone.se | A | 127.0.0.1 | 86400 | 0 | f | | t
9779 | 24 | ntp2.services.testzone.se | A | 127.0.0.1 | 86400 | 0 | f | | t
9766 | 24 | mail._domainkey.avtal.testzone.se | TXT | "k=rsa;p=LWLLLLLLLLNDN" | 86400 | 0 | f | | t

Metadata

Metadata

Assignees

Labels

dnsDNS ManagementuiUser Interface

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions