# Own modules
from .common import pp, to_bytes, to_utf8, to_bool
+from .common import RE_DOT_AT_END
from .errors import PpError
from .obj import PpBaseObjectError, PpBaseObject
from .pdns_record import PdnsApiRrset, PdnsSoaData
-__version__ = '0.4.3'
+__version__ = '0.4.4'
LOG = logging.getLogger(__name__)
return soa
+ # -------------------------------------------------------------------------
+ def get_zone_nameservers(self, for_zone=None):
+
+ nameservers = []
+
+ for rrset in self.rrsets:
+ if rrset.type == 'NS':
+ if for_zone:
+ if for_zone.lower() != rrset.name.lower():
+ continue
+ else:
+ if self.name.lower() != rrset.name.lower():
+ continue
+ for record in rrset.records:
+ ns = RE_DOT_AT_END.sub('.', record.content).lower()
+ nameservers.append(ns)
+
+ nameservers.sort()
+ return nameservers
+
# =============================================================================
if __name__ == "__main__":