File: mx.py

package info (click to toggle)
dnspython 2.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 2,556 kB
  • sloc: python: 37,194; sh: 7; makefile: 4
file content (7 lines) | stat: -rwxr-xr-x 189 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
#!/usr/bin/env python3

import dns.resolver

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