首页 > 其他分享 >通过dns api解析域名

通过dns api解析域名

时间:2023-02-01 21:24:22浏览次数:49  
标签:1.1 json accept headers 域名 api dns

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

相关文章