---
title: "API·检查域名状态"
description: "POST /api/v1/dns/manage/check_domain_status 接口，查询指定域名的注册信息、NS 当前/期望记录与解析状态，适用于判断 NS 是否已指向宝塔云解析。"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.bt.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# API·检查域名状态

## 检查域名状态

## 接口描述

检查指定域名的详细状态信息，包括注册信息、DNS 配置、解析状态等。

**接口地址：** `POST /api/v1/dns/manage/check_domain_status`

## 输入参数

### 请求示例

```json
{
  "domain_id": 14,
  "domain_type": 2
}
```

### 请求参数

| 参数名称 | 必选 | 类型 | 描述 |
|---------|------|------|------|
| domain_id | 是 | Integer | 域名 ID |
| domain_type | 是 | Integer | 域名类型：1（平台域名）、2（外部域名） |

## 输出参数

### 响应示例

**成功响应：**

```json
{
  "code": 0,
  "data": {
    "check_result": 0,
    "check_time": "2025-09-09 15:19:17",
    "current_ns": [],
    "domain_id": 14,
    "domain_type": 2,
    "expected_ns": [
      "ns1.51dns.com",
      "ns2.51dns.com"
    ],
    "full_domain": "example.com",
    "status_text": "检测中"
  },
  "msg": "DNS状态检测完成",
  "status": true
}
```

**错误响应：**

```json
{
  "code": 404,
  "msg": "域名不存在",
  "status": false
}
```

### 响应参数

| 参数名称 | 类型 | 描述 |
|---------|------|------|
| code | Integer | 状态码，0 表示成功 |
| status | Boolean | 请求是否成功 |
| msg | String | 返回消息 |
| data | Object | 域名状态详细信息 |

**data 字段说明：**

| 参数名称 | 类型 | 描述 |
|---------|------|------|
| check_result | Integer | 检查结果状态码 |
| check_time | String | 检查时间 |
| current_ns | Array | 当前 DNS 服务器列表 |
| domain_id | Integer | 域名 ID |
| domain_type | Integer | 域名类型：1（平台域名）、2（外部域名） |
| expected_ns | Array | 期望的 DNS 服务器列表 |
| full_domain | String | 域名名称 |
| status_text | String | 状态描述文本 |

## 状态说明

### 检查结果状态码 (check_result)

| 状态码 | 描述 |
|--------|------|
| 0 | 检测进行中 |
| 1 | 检测成功，DNS配置正确 |
| 2 | 检测失败，DNS配置错误 |

### 域名类型 (domain_type)

| 类型值 | 描述 |
|--------|------|
| 1 | 平台域名 |
| 2 | 外部域名 |

Source: https://docs.bt.cn/domain/api/dns-records/check-domain-status/index.mdx
