summaryrefslogtreecommitdiff
path: root/contrib/python/examples/python3/ldns-zone.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/python/examples/python3/ldns-zone.py')
-rwxr-xr-xcontrib/python/examples/python3/ldns-zone.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/python/examples/python3/ldns-zone.py b/contrib/python/examples/python3/ldns-zone.py
new file mode 100755
index 0000000..b465eaa
--- /dev/null
+++ b/contrib/python/examples/python3/ldns-zone.py
@@ -0,0 +1,15 @@
+#!/usr/bin/python
+import ldns
+
+#Read zone from file
+zone = ldns.ldns_zone.new_frm_fp(open("../zone.txt","r"), None, 0, ldns.LDNS_RR_CLASS_IN)
+print(zone)
+
+print("SOA:", zone.soa())
+for r in zone.rrs().rrs():
+ print("RR:", r)
+
+
+zone = ldns.ldns_zone()
+#print zone
+