1. Cloudflare dns api
curl -H "accept: application/dns-json" "https://1.1.1.1/dns-query?name=baidu.com"
import requests headers = {"accept": "application/dns-json"} r = requests.get("https://1.1.1.1/dns-query?name=baidu.com",headers=headers,verify=False) print(r.json())
2. google dns api
curl -H "accept: application/dns-json" "https://8.8.8.8/resolve?name=baidu.com"
import requests headers = {"accept": "application/dns-json"} r = requests.get("https://8.8.8.8/resolve?name=baidu.com",headers=headers,verify=False) print(r.json())
标签:1.1,json,accept,headers,域名,api,dns From: https://www.cnblogs.com/276815076/p/17084142.html