File: mx.py

package info (click to toggle)
dnspython3 1.10.0-1
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 952 kB
  • sloc: python: 9,553; makefile: 18
file content (8 lines) | stat: -rwxr-xr-x 188 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
#!/usr/bin/env python3

import dns.resolver

answers = dns.resolver.query('nominum.com', 'MX')
for rdata in answers:
    print('Host', rdata.exchange, 'has preference', rdata.preference)