CDN加速

文档中心 API文档 域名管理 dns查询解析记录

dns查询解析记录

更新时间:2020-01-17 16:26:53
适用产品:云解析

接口描述

用于查询解析记录

请求参数

参数名称类型必填描述
customerstring客户名称
namestring主机头关键字
valuestring记录值关键字

返回参数

参数名称类型描述
typeGrouplist记录类型分组
┗namestring主机头
┗valuestring记录值
┗ttlintttl
┗recordIdint记录id
┗typestring记录类型
┗domainIdintdomain的id
┗emailstringsoa email
┗serialNumberstringsoa序列号

错误码

错误代码(code)描述(message)HTTP状态码语义
19222101用户不存在400无法查询到该用户
19222104输入参数错误400输入参数错误(没有输入值或者值不符合规范)
19222404域名不存在400域名不存在
19222999其他暂时错误400其他暂时错误

示例

示例说明
请求示例
复制
#!/bin/bash
username="<example_username>"
apiKey="<example_apiKey>"
date=`env LANG="en_US.UTF-8" date -u "+%a, %d %b %Y %H:%M:%S GMT"`
password=`echo -en "$date" | openssl dgst -sha1 -hmac $apiKey -binary | openssl enc -base64`

curl -i --url "https://open.chinanetcenter.com/api/open-api/cdns/domains/52/records/list" \
-X "POST" \
-u "$username:$password" \
-H "Date: $date" \
-H "Accept-Language: en" \
-H "Content-Type: application/json" \
-d '{"customer":"example_customer"}'
返回示例
复制
{
        "data":{
            "SOA":[
                {
                    "retry":3600,
                    "minmum":300,
                    "value":"ns1.cdnetdns.net",
                    "class":"IN",
                    "email":"root2@cdnetworks.co.kr",
                    "expire":604800,
                    "refresh":43200,
                    "ttl":3601,
                    "recordId":52,
                    "serialNumber":2013060529,
                    "type":"SOA",
                    "domainId":52
                }
            ],
            "A":[
                {
                    "name":"@",
                    "value":"91.194.205.32",
                    "ttl":3600,
                    "recordId":75947,
                    "type":"A",
                    "domainId":52
                },
                {
                    "name":"www",
                    "value":"8.54.235.10",
                    "ttl":3600,
                    "recordId":237815,
                    "type":"A",
                    "domainId":52
                }
            ],
            "TXT":[
                {
                    "name":"@",
                    "value":"v=spf1 ~all",
                    "ttl":0,
                    "recordId":398,
                    "type":"TXT",
                    "domainId":52
                }
            ],
            "AAAA":[
                {
                    "name":"ipv6",
                    "value":"2607:f0d0:1002:51::4",
                    "ttl":300,
                    "recordId":12,
                    "type":"AAAA",
                    "domainId":52
                }
            ],
            "CNAME":[
                {
                    "name":"cname",
                    "value":"www1.kr.cdngp.net",
                    "ttl":300,
                    "recordId":13713,
                    "type":"CNAME",
                    "domainId":52
                },
                {
                    "name":"CNAME.ADD.DATA",
                    "value":"www1.kr.cdngp.net",
                    "ttl":0,
                    "recordId":13719,
                    "type":"CNAME",
                    "domainId":52
                }
            ],
            "NS":[
                {
                    "name":"@",
                    "value":"ns2.cdnetdns.net",
                    "ttl":null,
                    "recordId":1097,
                    "type":"NS",
                    "domainId":52
                },
                {
                    "name":"@",
                    "value":"ns1.cdngp.net",
                    "ttl":2147483647,
                    "recordId":11401,
                    "type":"NS",
                    "domainId":52
                },
                {
                    "name":"ns.master.cdngp.net",
                    "value":"ns1.cdngp.net",
                    "ttl":300,
                    "recordId":11409,
                    "type":"NS",
                    "domainId":52
                }
            ],
            "MX":[
                {
                    "name":"googlesmtp",
                    "value":"smtp.google.com.update",
                    "preference":0,
                    "ttl":0,
                    "recordId":903,
                    "type":"MX",
                    "domainId":52
                },
                {
                    "name":"googleapps",
                    "value":"smtp.google.com",
                    "preference":10,
                    "ttl":2147483647,
                    "recordId":902,
                    "type":"MX",
                    "domainId":52
                }
            ]
        },
        "code":"0",
        "message":"Success"

}