获取用户DNS域名列表
接口描述
获取账户下的域名列表,支持分页和筛选。
接口地址: POST /api/v1/dns/manage/list_domains
输入参数
请求示例
{
"p": 1,
"rows": 20,
"keyword": "example"
}
请求参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| p | 否 | Integer | 页码,从 1 开始,默认为 1 |
| rows | 否 | Integer | 每页返回数量,默认为 20 |
| keyword | 否 | String | 域名关键字搜索,支持域名(full_domain)和备注(remark)搜索 |
输出参数
响应示例
成功响应:
{
"code": 0,
"status": true,
"msg": "获取域名列表成功",
"data": {
"data": [
{
"created_at": "Tue, 09 Sep 2025 11:49:54 GMT",
"dns_id": 0,
"domain_type": 2,
"full_domain": "example.com",
"last_check_time": null,
"local_id": 1,
"ns_status": 0,
"record_count": 0,
"remark": "",
"source": "external"
},
{
"created_at": "Mon, 08 Sep 2025 11:46:20 GMT",
"dns_id": 196311160,
"domain_type": 1,
"full_domain": "test.com",
"last_check_time": null,
"local_id": 75,
"ns_status": 1,
"record_count": 0,
"remark": "",
"source": "platform"
}
],
"page": "<div><span class='Pcurrent'>1</span><a class='Pnum' onclick='list_domains(2)'>2</a><a class='Pnext' onclick='list_domains(2)'>下一页</a><a class='Pend' onclick='list_domains(2)'>尾页</a><a class='Pcount'>共12条数据</span></div>",
"row": "10",
"shift": "0",
"total": 12
}
}
错误响应:
{
"code": 400,
"status": false,
"msg": "参数错误"
}
响应参数
| 参数名称 | 类型 | 描述 |
|---|---|---|
| code | Integer | 响应状态码,0 表示成功 |
| status | Boolean | 请求是否成功 |
| msg | String | 返回消息 |
| data | Object | 返回数据 |
data 字段说明:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| data | Array | 域名列表数组 |
| page | String | 分页 HTML 代码 |
| row | String | 每页显示数量 |
| shift | String | 偏移量 |
| total | Integer | 总记录数 |
data 数组中每个域名对象的字段:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| created_at | String | 创建时间 |
| dns_id | Integer | 51DNS 中的域名 ID,0 表示未在 51DNS 中创建 |
| domain_type | Integer | 域名类型:1=平台注册域名,2=外部添加域名 |
| full_domain | String | 完整域名 |
| last_check_time | String/null | 最后 DNS 状态检测时间 |
| local_id | Integer | 本地数据库中的域名 ID |
| ns_status | Integer | NS 状态:0=未设置,1=已生效,2=未生效 |
| record_count | Integer | DNS 解析记录数量 |
| remark | String | 备注信息 |
| source | String | 域名来源:platform=平台注册,external=外部添加 |
错误码
| 错误码 | 错误信息 | 描述 |
|---|---|---|
| 0 | 获取域名列表成功 | 请求成功 |
| 404 | 参数错误 | 请求参数格式不正确 |