Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ zone.create_records([
powerdns.RRSet('a', 'A', [('1.1.1.1', False)], comments=comments),
powerdns.RRSet('b', 'A', ['1.1.1.2', '1.1.1.3']),
powerdns.RRSet('c', 'A', [('1.1.1.4', False)]),
powerdns.RRSet('d', 'CNAME', ['a'])
powerdns.RRSet('d', 'CNAME', ['a']),
# Added TXT record for "test.python-powerdns.domain.tld."
powerdns.RRSet('','TXT', [('"v=spf1 mx include:spf.domain.tld ~all"', False)]),
# Added MX record for "test.python-powerdns.domain.tld."
powerdns.RRSet('','MX', [('10 mx.domain.tld.', False)])
])

zone.delete_records([
Expand Down
4 changes: 4 additions & 0 deletions powerdns/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ def ensure_canonical(self, zone):
LOG.debug("ensuring rrset %s is canonical", self['name'])
if not zone.endswith('.'):
raise PDNSCanonicalError(zone)
# Allowed add TXT and MX record, because record string must be empty
if not self['name']:
LOG.debug("transforming %s with %s", self['name'], zone)
self['name'] += "%s" % zone
if not self['name'].endswith('.'):
LOG.debug("transforming %s with %s", self['name'], zone)
self['name'] += ".%s" % zone
Expand Down