https://blog.csdn.net/HeatDeath/article/details/80548310
https://blog.csdn.net/chosen0ne/article/details/7319306
https://www.cnblogs.com/huan-ge/p/6822817.html
https://www.cnblogs.com/robinunix/p/5729503.html
https://blog.csdn.net/xsjyahoo/article/details/51568712
网络模块
DNS处理模块dnspython:是python实现的一个DNS工具包,利用其查询功能来实现dns的服务监控及解析结果的校验。常见的DNS解析类型包括A、MX、NS、CNAME。
# encoding:utf-8 import dns.resolver # A记录的查询 def query_A(domain): result = dns.resolver.query(domain, 'A') for i in result.response.answer: for j in i.items: print j.address # MX记录的查询 def query_MX(domain): result = dns.resolver.query(domain, 'MX') for i in result: print 'MX preference =', i.preference, 'mail exchanger =', i.exchange # CNAME记录的查询 def query_CNAME(domain): result = dns.resolver.query(domain, 'CNAME') for i in result.response.answer: for j in i.items: print j.to_text() if __name__=='__main__': domain = "www.baidu.com" query_A(domain) # query_MX(domain)