tencent cloud

APIs

DescribeDnsRecords

Baixar
Modo Foco
Tamanho da Fonte
Última atualização: 2026-11-25 16:59:56

1. API Description

Domain name for API request: teo.intl.tencentcloudapi.com.

This API is used to view DNS records under a site, including DNS record names, record types, and record content. It supports specifying filter conditions to query specific DNS records.

A maximum of 20 requests can be initiated per second for this API.

We recommend you to use API Explorer
Try it
API Explorer provides a range of capabilities, including online call, signature authentication, SDK code generation, and API quick search. It enables you to view the request, response, and auto-generated examples.

2. Input Parameters

The following request parameter list only provides API request parameters and some common parameters. For the complete common parameter list, see Common Request Parameters.

Parameter Name Required Type Description
Action Yes String Common Params. The value used for this API: DescribeDnsRecords.
Version Yes String Common Params. The value used for this API: 2022-09-01.
Region No String Common Params. This parameter is not required.
ZoneId Yes String Zone ID.
Offset No Integer Offset of paginated query. Default value: 0.
Limit No Integer Number limit of paginated query. Default value: 20. Maximum value: 1000.
Filters.N No Array of AdvancedFilter Filter criteria. The maximum number of Filters.Values is 20. The detailed filter criteria are as follows:
  • id: Filter by DNS record ID. Fuzzy query is supported.
  • name: Filter by DNS record name. Fuzzy query is supported.
  • content: Filter by DNS record content. Fuzzy query is supported.
  • type: Filter by DNS record type. Fuzzy query is not supported. Options:
    A: Point the domain to an external IPv4 address, such as 8.8.8.8.
    AAAA: Point the domain to an external IPv6 address.
    CNAME: Point the domain to another domain, which then resolves to the final IP address.
    TXT: Identify and describe the domain. Commonly used for domain verification and SPF records (anti-spam).
    NS: If you need to delegate a subdomain to another DNS service provider for resolution, you need to add an NS record. NS records cannot be added for root domains.
    CAA: Specify the CA that can issue certificates for this site.
    SRV: Identify that a server uses a service. Commonly used for directory management in Microsoft systems.
    MX: Specify the recipient mail server.
  • ttl: Filter by resolution time. Fuzzy query is not supported.
  • SortBy No String Sorting basis. Valid values:
  • content: DNS record content;
  • created-on: DNS record creation time;
  • name: DNS record name;
  • ttl: cache time;
  • type: DNS record type.
  • Default sorting order: by the combination of type and name attributes.
    SortOrder No String List sort method. Valid values:
  • asc: ascending sort;
  • desc: descending sort.
  • Default value: asc.
    Match No String Match mode. Valid values:
  • all: return records that match all query conditions;
  • any: return records that match any query condition.
  • Default value: all.

    3. Output Parameters

    Parameter Name Type Description
    TotalCount Integer Total number of DNS records.
    DnsRecords Array of DnsRecord DNS record list.
    RequestId String The unique request ID, generated by the server, will be returned for every request (if the request fails to reach the server for other reasons, the request will not obtain a RequestId). RequestId is required for locating a problem.

    4. Example

    Example1 Query the DNS record list by specified record ID

    Query the DNS record list with record ID record-3277epj0rm2y under the selected site with ZoneId zone-2zo8myp3av8i, and sort by record creation time in descending order.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDnsRecords
    <Common request parameters>
    
    {
        "ZoneId": "zone-2zo8myp3av8i",
        "Offset": 0,
        "Limit": 100,
        "Filters": [
            {
                "Fuzzy": false,
                "Values": [
                    "record-3277epj0rm2y"
                ],
                "Name": "id"
            }
        ],
        "SortBy": "created-on",
        "SortOrder": "desc"
    }

    Output Example

    {
        "Response": {
            "TotalCount": 1,
            "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
            "DnsRecords": [
                {
                    "ZoneId": "zone-2zo8myp3av8i",
                    "RecordId": "record-3277epj0rm2y",
                    "Name": "test.example.com",
                    "Type": "A",
                    "Location": "Default",
                    "Content": "1.1.1.1",
                    "TTL": 300,
                    "Weight": -1,
                    "Priority": 5,
                    "Status": "enable",
                    "CreatedOn": "2024-09-18T05:03:46Z",
                    "ModifiedOn": "2024-09-18T05:03:46Z"
                }
            ]
        }
    }

    Example2 Query the DNS record list with a blurry record name

    Query the list of DNS records with the record name example under the site with ZoneId zone-2zo8myp3av8i, and sort them by record name in ascending order.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDnsRecords
    <Common request parameters>
    
    {
        "ZoneId": "zone-2zo8myp3av8i",
        "Offset": 0,
        "Limit": 100,
        "Filters": [
            {
                "Fuzzy": true,
                "Values": [
                    "example"
                ],
                "Name": "name"
            }
        ],
        "SortBy": "name",
        "SortOrder": "asc"
    }

    Output Example

    {
        "Response": {
            "TotalCount": 2,
            "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
            "DnsRecords": [
                {
                    "ZoneId": "zone-2zo8myp3av8i",
                    "RecordId": "record-3277epj0rm2y",
                    "Name": "test.example.com",
                    "Type": "A",
                    "Location": "Default",
                    "Content": "1.1.1.1",
                    "TTL": 300,
                    "Weight": 40,
                    "Priority": 5,
                    "Status": "enable",
                    "CreatedOn": "2024-09-18T05:03:46Z",
                    "ModifiedOn": "2024-09-18T05:03:46Z"
                },
                {
                    "ZoneId": "zone-2zo8myp3av8i",
                    "RecordId": "record-3277epj0rm2y",
                    "Name": "test.example.com",
                    "Type": "A",
                    "Location": "Default",
                    "Content": "2.2.2.2",
                    "TTL": 300,
                    "Weight": 60,
                    "Priority": 5,
                    "Status": "enable",
                    "CreatedOn": "2024-09-18T05:03:46Z",
                    "ModifiedOn": "2024-09-18T05:03:46Z"
                }
            ]
        }
    }

    Example3 Query the DNS record list of a specified record type

    Query the list of DNS records with the record type CNAME under the site with ZoneId zone-2zo8myp3av8i, and sort them by record content in ascending order.

    Input Example

    POST / HTTP/1.1
    Host: teo.intl.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDnsRecords
    <Common request parameters>
    
    {
        "ZoneId": "zone-2zo8myp3av8i",
        "Offset": 0,
        "Limit": 100,
        "Filters": [
            {
                "Fuzzy": false,
                "Values": [
                    "CNAME"
                ],
                "Name": "type"
            }
        ],
        "SortBy": "content",
        "SortOrder": "asc"
    }

    Output Example

    {
        "Response": {
            "TotalCount": 2,
            "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
            "DnsRecords": [
                {
                    "ZoneId": "zone-2zo8myp3av8i",
                    "RecordId": "record-3277epj0rm2y",
                    "Name": "test.example.com",
                    "Type": "CNAME",
                    "Location": "CN.BJ",
                    "Content": "test1.eo.dnse2.com",
                    "TTL": 300,
                    "Weight": -1,
                    "Priority": 0,
                    "Status": "enable",
                    "CreatedOn": "2024-09-18T05:03:46Z",
                    "ModifiedOn": "2024-09-18T05:03:46Z"
                },
                {
                    "ZoneId": "zone-2zo8myp3av8i",
                    "RecordId": "record-3277epj0rm2y",
                    "Name": "test.example.com",
                    "Type": "CNAME",
                    "Location": "CN.FJ",
                    "Content": "test2.eo.dnse2.com",
                    "TTL": 300,
                    "Weight": -1,
                    "Priority": 0,
                    "Status": "enable",
                    "CreatedOn": "2024-09-18T05:03:46Z",
                    "ModifiedOn": "2024-09-18T05:03:46Z"
                }
            ]
        }
    }

    5. Developer Resources

    SDK

    TencentCloud API 3.0 integrates SDKs that support various programming languages to make it easier for you to call APIs.

    Command Line Interface

    6. Error Code

    There is no error code related to the API business logic. For other error codes, please see Common Error Codes.

    Ajuda e Suporte

    Esta página foi útil?

    comentários