Tuesday, December 14, 2010

simple py script for mx query

import dns.resolver
site = raw_input("enter site name\n--->")
rec = dns.resolver.query(site, 'MX')
for rdata in rec:
    print 'Host', rdata.exchange, 'has preference', rdata.preference
      

No comments:

Post a Comment