DNSfish API · v1

面向运维、监控与 CI 的 DNS API。

与站点同一套引擎,提供 JSON、JSONP 与 DoH 接口。公开层无需 API 密钥。

试用批量查询API 健康检查查看文档

公开层无需 API 密钥,边缘层有速率限制。

GET/v1/lookup/:domain200 OK

针对指定解析器查询域名的全部记录类型。可使用 ?types=A,MX,TXT 限定返回类型。

参数

名称类型默认值说明
domainstring必填,需要查询的主机名。
typesstring[]all逗号分隔,例如 A,AAAA,MX
resolverstringcloudflare可选 cloudflare、google、quad9、opendns、auth

请求示例

cURL
$ curl "https://dnsfish.com/v1/lookup/github.com" \
-H "Accept: application/json"

响应

application/json200 OK
{
"domain": "github.com",
"resolver": "cloudflare",
"queried_at": "2026-05-24T18:42:11Z",
"latency_ms": 42,
"dnssec": { "signed": false, "ad": false },
"answers": {
"A": [{ "value": "140.82.114.4", "ttl": 60 }],
"MX": [{ "priority": 1, "value": "aspmx.l.google.com." }, /* 还有 4 条 */]
}
}

SDK 代码

JavaScript (fetch)
const r = await fetch(
"https://dnsfish.com/v1/lookup/github.com"
)
const data = await r.json()
console.log(data.answers.A)
Python (requests)
import requests
r = requests.get(
"https://dnsfish.com/v1/lookup/github.com"
)
print(r.json()["answers"]["A"])
Go (net/http)
resp, _ := http.Get(
"https://dnsfish.com/v1/lookup/github.com")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
Shell (curl + jq)
$ curl -s "https://dnsfish.com/v1/lookup/github.com" \
| jq '.answers.A[].value'
"140.82.114.4"