---
title: "API·添加外部域名"
description: "POST /api/v1/dns/manage/add_external_domain 接口详解，将其他注册商的域名接入宝塔域名管理系统并启用 DNS 解析，包含 full_domain、remark 参数与响应示例。"
---

> 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/add_external_domain`

## 输入参数

### 请求示例

```json
{
  "full_domain": "example.com",
  "remark": ""
}
```

### 请求参数

| 参数名称 | 必选 | 类型 | 描述 |
|---------|------|------|------|
| full_domain | 是 | String | 域名名称，需要是有效的域名格式 |
| remark | 否 | String | 备注信息 |

## 输出参数

### 响应示例

**成功响应：**

```json
{
  "code": 0,
  "data": {
    "dns_id": 196336355,
    "domain_id": 2,
    "full_domain": "example.com",
    "ns_status": 0
  },
  "msg": "外部域名添加成功",
  "status": true
}
```

**错误响应：**

```json
{
  "code": 400,
  "msg": "域名格式不正确",
  "status": false
}
```

### 响应参数

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

**data 字段说明：**

| 参数名称 | 类型 | 描述 |
|---------|------|------|
| dns_id | Integer | DNS 解析 ID |
| domain_id | Integer | 域名 ID |
| full_domain | String | 域名名称 |
| ns_status | Integer | 当前 DNS 状态：0（未设置）、1（已设置）、2（检测中） |

Source: https://docs.bt.cn/domain/api/dns-records/add-external-domain/index.mdx
