Network

DNS Resolution Query

0calls
2 credits / call

Want to know which IP a domain points to? Or who its mail server is? This endpoint is like an online dig or nslookup tool.

GET
uapis.cn
/api/v1/network/dns
Query parameters
2
domain
string
required

The domain name you want to query, e.g., 'cn.bing.com'.

type
string

The DNS record type you want to query.

Overview

You can query various DNS records for a specified domain, including A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail exchange), NS (name server) and TXT (text records).

Query parameters

domain
stringrequired

The domain name you want to query, e.g., 'cn.bing.com'.

type
stringoptional

The DNS record type you want to query.

Response

200 / OK

Query successful! Returns the list of resolved DNS records.

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 / Bad Request

Invalid request parameters. Please check if the domain parameter is provided and formatted correctly.

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

404 / Not Found

DNS records not found. The domain may not exist, or there are no records of the type you queried (e.g., a domain without MX records configured).

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