File: mx.py

package info (click to toggle)
dnspython 1.16.0-1%2Bdeb10u1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,520 kB
  • sloc: python: 12,540; makefile: 62
file content (9 lines) | stat: -rwxr-xr-x 225 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
#!/usr/bin/env python

from __future__ import print_function

import dns.resolver

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