summaryrefslogtreecommitdiff
path: root/contrib/python/examples/ldns-zone.py
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2012-07-04 14:22:28 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2012-07-04 14:22:28 +0000
commita1ba2d1ca3a1d6c9c36a79a196dd3ccb83ede353 (patch)
treeae20718827f0ca6f869c0f7bdb777816d3bf5f3a /contrib/python/examples/ldns-zone.py
Notes
Diffstat (limited to 'contrib/python/examples/ldns-zone.py')
-rwxr-xr-xcontrib/python/examples/ldns-zone.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/contrib/python/examples/ldns-zone.py b/contrib/python/examples/ldns-zone.py
new file mode 100755
index 000000000000..266e6e5b4719
--- /dev/null
+++ b/contrib/python/examples/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
+