File: mx.py

package info (click to toggle)
dnspython 2.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,448 kB
  • sloc: python: 34,885; sh: 7; makefile: 4
file content (7 lines) | stat: -rwxr-xr-x 189 bytes parent folder | download | duplicates (2)
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)