summaryrefslogtreecommitdiffstats
path: root/skripti/zone/axfr.py
diff options
context:
space:
mode:
authorAnton Luka Šijanec <anton@sijanec.eu>2024-06-03 18:54:14 +0200
committerAnton Luka Šijanec <anton@sijanec.eu>2024-06-03 18:54:14 +0200
commit3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb (patch)
treedc51ea1b9dc4429546c50dd54d232e81dd0538fd /skripti/zone/axfr.py
parentds2teor (diff)
parentrazne stvari iz b (diff)
downloadr-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.tar
r-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.tar.gz
r-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.tar.bz2
r-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.tar.lz
r-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.tar.xz
r-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.tar.zst
r-3a239dd1b3bc6536ea663ab12567f7a9b71dfbeb.zip
Diffstat (limited to 'skripti/zone/axfr.py')
-rwxr-xr-xskripti/zone/axfr.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/skripti/zone/axfr.py b/skripti/zone/axfr.py
index fe508f1..11eaad9 100755
--- a/skripti/zone/axfr.py
+++ b/skripti/zone/axfr.py
@@ -20,8 +20,8 @@ for naslov in naslovi: # opcijsko dodaj tule kakšen try catch
break
config = None
try:
- config = json.loads(b''.join(dns.resolver.resolve("_urejevalnik." + domena, "TXT")[0].strings).decode())
-except dns.resolver.NXDOMAIN:
+ config = json.loads(b''.join(zone["_urejevalnik"].get_rdataset(dns.rdataclass.IN, dns.rdatatype.TXT)[0].strings).decode())
+except KeyError:
pass
except json.decoder.JSONDecodeError:
pass
@@ -53,7 +53,8 @@ for r in zone.iterate_rdatas():
konec = config["i"][r[0].to_unicode()]
print(r[0].to_unicode(), end=konec)
if r[1] != config["t"]:
- print(r[1], end="\t")
+ print(r[1], end="")
+ print("\t", end="")
if r[2].rdclass != dns.rdataclass.IN:
print(r[2].rdataclass.name, end="\t")
print(r[2].rdtype.name, end="\t")