Move dnspython to third_party.
[bbaumbach/samba-autobuild/.git] / third_party / dnspython / examples / mx.py
diff --git a/third_party/dnspython/examples/mx.py b/third_party/dnspython/examples/mx.py
new file mode 100755 (executable)
index 0000000..3036e70
--- /dev/null
@@ -0,0 +1,7 @@
+#!/usr/bin/env python
+
+import dns.resolver
+
+answers = dns.resolver.query('nominum.com', 'MX')
+for rdata in answers:
+    print 'Host', rdata.exchange, 'has preference', rdata.preference