#!/usr/bin/env python # -*- coding: utf-8 -*- import dns.resolver #mx domain=raw_input(‘Please input an domain:‘) MX = dns.resolver.query(domain,‘MX‘) for i in MX: print ‘MX preference =‘,i.preference,‘mail exchanger =‘,i.exchange #ns domain = raw_input(‘Please input an domain:‘) ns = dns.resolver.query(domain,‘NS‘) for i in ns.response.answer: for j in i.items: print j.to_text()
本文出自 “Sanr” 博客,请务必保留此出处http://0x007.blog.51cto.com/6330498/1688506
原文地址:http://0x007.blog.51cto.com/6330498/1688506