tencent cloud

All product documents
Tencent Cloud EdgeOne
DescribeDnsRecords
Last updated: 2025-02-19 19:33:27
DescribeDnsRecords
Last updated: 2025-02-19 19:33:27

1. API Description

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

This API is used to view DNS record information under a site, including DNS record name, record type, and record content. It supports querying specific DNS record information by specifying filter conditions.

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 conditions. up to 20 values for each filter. detailed filter conditions are as follows:
  • id: filter by dns record id, supports fuzzy search;
  • name: filter by dns record name, supports fuzzy search;
  • content: filter by dns record content, supports fuzzy search;
  • type: filter by dns record type, does not support fuzzy search. valid values:
       a: points the domain name to an external ipv4 address, such as 8.8.8.8;
       aaaa: points the domain name to an external ipv6 address;
       cname: points the domain name to another domain name, which then resolves to the final ip address;
       txt: identifies and describes the domain name, commonly used for domain verification and spf records (anti-spam);
       ns: if you need to delegate the subdomain to another dns service provider, you need to add an ns record. root domain cannot add ns records;
       caa: specifies the ca that can issue certificates for this site;
       srv: identifies a server using a specific service, commonly used in microsoft's directory management;
       mx: specifies the recipient's mail server.
  • ttl: filter by resolution effective time, does not support fuzzy search.
  • .
    SortBy No String Sorting basis. values include:
  • content: dns record content
  • created-on: dns record creation time
  • name: dns record name
  • ttl: cache time
  • type: dns record type
  • default sorting is by the combination of type, name.
    SortOrder No String List sort method. values:
  • asc: ascending order
  • desc: sort in descending order
  • default value: asc.
    Match No String Match method. 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 List of dns records.
    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 With Specified Record IDs

    At the site with ZoneId zone-2zo8myp3av8i, query the DNS record list with record ID record-3277epj0rm2y and sort by 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 Fuzzy Query the DNS Record List With Specified Record Names

    This example shows you how to perform a fuzzy query for DNS record lists with the record name "example" under the site with ZoneId zone-2zo8myp3av8i, and sort them in ascending order by record name.

    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 With Specified Record Types

    This example shows you how to query DNS record lists with the record type CNAME under the site with ZoneId zone-2zo8myp3av8i, and sort them in ascending order by record content.

    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.

    Was this page helpful?
    You can also Contact Sales or Submit a Ticket for help.
    Yes
    No

    Feedback

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 available.

    7x24 Phone Support
    Hong Kong, China
    +852 800 906 020 (Toll Free)
    United States
    +1 844 606 0804 (Toll Free)
    United Kingdom
    +44 808 196 4551 (Toll Free)
    Canada
    +1 888 605 7930 (Toll Free)
    Australia
    +61 1300 986 386 (Toll Free)
    EdgeOne hotline
    +852 300 80699
    More local hotlines coming soon