aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/get_catalog15
1 files changed, 14 insertions, 1 deletions
diff --git a/bin/get_catalog b/bin/get_catalog
index 39c8a37..4c069ac 100755
--- a/bin/get_catalog
+++ b/bin/get_catalog
@@ -30,9 +30,22 @@ def axfr(zonename, hostname):
raise (last_exc)
def print_catalog(zone):
+ def origin(node):
+ try:
+ return [
+ ''.join(s.decode('utf-8') for s in rdata.strings)
+ for rdata in
+ zone.find_node(f"origin.ext.{node}")
+ .find_rdataset(dns.rdataclass.IN,
+ dns.rdatatype.TXT)
+ ]
+ except KeyError:
+ return []
+
nodes = [node
for (name, node) in zone.nodes.items()
- if len(name) == 2 and name[1] == b"zones"]
+ if len(name) == 2 and name[1] == b"zones"
+ and not "dn42" in origin(name)]
ptrs = [str(ptr.target).rstrip('.')
for node in nodes