核心就是requests取域名
python环境是python3.6
#!/usr/bin/env python# -*- coding: utf-8 -*-import requestsdef getip(): ???hostinput = input(‘Please input the url:‘) ???hufur=requests.get("http://119.29.29.29/d",params={‘dn‘: requests.urllib3.get_host(hostinput)[1]},timeout=0.1) ???print("The real IP: %s" % (hufur.content.decode(‘utf-8‘)))getip()
测试httpdns
原文地址:http://blog.51cto.com/yjw1983/2065036