summaryrefslogtreecommitdiff
path: root/contrib/ldnsx/examples/ldnsx-mx1.py
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ldnsx/examples/ldnsx-mx1.py')
-rw-r--r--contrib/ldnsx/examples/ldnsx-mx1.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/contrib/ldnsx/examples/ldnsx-mx1.py b/contrib/ldnsx/examples/ldnsx-mx1.py
new file mode 100644
index 0000000..60dfc42
--- /dev/null
+++ b/contrib/ldnsx/examples/ldnsx-mx1.py
@@ -0,0 +1,11 @@
+import ldnsx
+
+resolver = ldnsx.resolver()
+
+pkt = resolver.query("nic.cz", "MX")
+
+if (pkt):
+ mx = pkt.answer()
+ if (mx):
+ mx.sort()
+ print mx