网络

执行DNS解析查询

0次调用
2 积分/次

想知道一个域名指向了哪个IP?或者它的邮件服务器是谁?这个接口就像一个在线的 dignslookup 工具。

GET
uapis.cn
/api/v1/network/dns
查询参数
2
domain
string
required

你需要查询的域名,例如 'cn.bing.com'。

type
string

你想要查询的DNS记录类型。

功能概述

你可以查询指定域名的各种DNS记录,包括 A (IPv4), AAAA (IPv6), CNAME (别名), MX (邮件交换), NS (域名服务器) 和 TXT (文本记录)。

查询参数

domain
string必填

你需要查询的域名,例如 'cn.bing.com'。

type
string可选

你想要查询的DNS记录类型。

响应

200 / 请求成功

查询成功!返回解析到的DNS记录列表。

JSON
{
  "domain": "cn.bing.com",
  "error": "",
  "records": [
    {
      "content": "v=spf1 ...",
      "flag": 0,
      "port": 443,
      "pri": 10,
      "tag": "issue",
      "target": "1.2.3.4",
      "weight": 5
    }
  ],
  "type": "A"
}

400 / 错误的请求

请求参数无效。请检查 domain 参数是否提供且格式正确。

JSON
{
  "code": "INVALID_ARGUMENT",
  "details": {},
  "message": "Missing or invalid 'domain' parameter."
}

404 / 未找到

未找到DNS记录。该域名可能不存在,或者不存在你所查询类型的记录(例如,一个没有配置MX记录的域名)。

JSON
{
  "code": "NOT_FOUND",
  "details": {},
  "message": "No DNS records found for the specified domain and type."
}