tencent cloud

文档反馈

DescribeDnsRecords

最后更新时间:2022-11-28 16:50:33
This document is currently invalid. Please refer to the documentation page of the product.

1. API Description

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

This API is used to query DNS records. Paging, sorting and filtering are supported.

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 Yes String Common Params. For more information, please see the list of regions supported by the product.
ZoneId No String The site ID of the DNS record. All sites’ DNS records will be returned if this field is not specified.
Filters.N No Array of AdvancedFilter Filter criteria. Each filter criteria can have up to 20 entries.
  • record-id:
    Filter by DNS record ID, such as record-1a8df68z
    Type: String
    Required: No
  • record-name:
    Filter by DNS record name
    Type: String
    Required: No
  • record-type:
    Filter by DNS record type
    Type: String
    Required: No
    Values:
    A: Point a domain name to an IPv4 address, such as 8.8.8.8.
    AAAA: Point a domain name to an IPv6 address.
    CNAME: Point a domain name to another domain name that can be resolved to an IP address.
    TXT: Identify and describe a domain name. It is usually used for domain verification and as SPF records (for anti-spam).
    NS: If you need to authorize a subdomain name to another DNS service provider for DNS resolution, you need to add an NS record. You cannot add an NS record for a root domain name.
    CAA: Specify CAs to issue certificates for sites.
    SRV: Identify a service used by a server. It is commonly used in Microsoft directory management.
    MX: Specify the mail server for receiving emails.
  • mode:
    Filter by proxy mode
    Type: String
    Required: No
    Values:
    dns_only: Only DNS
    proxied: Proxied
  • ttl:
    Filter by TTL
    Type: String
    Required: No
  • Direction No String The sorting order. Values:
  • ASC: Ascending order
  • desc: Descending order
  • Default value: asc
    Match No String The match mode. Values:
  • all: Return all records that match the specified filter.
  • any: Return any record that matches the specified filter.
  • Default value: all.
    Limit No Integer The paginated query limit. Default value: 20. Maximum value: 1000.
    Offset No Integer The page offset. Default value: 0
    Order No String The sorting criteria. Values:
  • content: DNS record content.
  • created_on: Creation time of the DNS record.
  • mode: Proxy mode.
  • record-name: DNS record name.
  • ttl: DNS TTL.
  • record-type: DNS record type.
  • If this field is not specified, the DNS records are sorted based on record-type and recrod-name.

    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, which is returned for each request. RequestId is required for locating a problem.

    4. Example

    Example1 dns_records

    Input Example

    POST / HTTP/1.1
    Host: teo.tencentcloudapi.com
    Content-Type: application/json
    X-TC-Action: DescribeDnsRecords
    <Common request parameters>
    
    {
        "Direction": "desc",
        "ZoneId": "zone-20hyebgyfsko",
        "Limit": 0,
        "Filters": [
            {
                "Fuzzy": true,
                "Values": [
                    "record-3d5dg39c"
                ],
                "Name": "record-id"
            }
        ],
        "Offset": 0,
        "Order": "created_on",
        "Match": "all"
    }
    

    Output Example

    {
        "Response": {
            "TotalCount": 0,
            "RequestId": "3c140219-cfe9-470e-b241-907877d6fb03",
            "DnsRecords": [
                {
                    "Status": "active",
                    "Priority": 0,
                    "ModifiedOn": "2020-09-22T00:00:00+00:00",
                    "DnsRecordName": "test.example.com",
                    "CreatedOn": "2020-09-22T00:00:00+00:00",
                    "ZoneId": "zone-20hyebgyfsko",
                    "Content": "110.242.68.66",
                    "Cname": "test.example.com.cdn.acc.xyz",
                    "Mode": "dns_only",
                    "TTL": 0,
                    "Locked": true,
                    "DnsRecordType": "A",
                    "DnsRecordId": "record-3d5dg39c",
                    "ZoneName": "example.com",
                    "DomainStatus": [
                        "lb"
                    ]
                }
            ]
        }
    }
    

    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

    The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.

    Error Code Description
    InvalidParameter.DomainOnTrafficScheduling Traffic scheduling is enabled for the current domain name.
    OperationDenied Operation denied.
    UnauthorizedOperation.CamUnauthorized CAM is not authorized.
    UnauthorizedOperation.NoPermission The sub-account is not authorized for the operation. Please get permissions first.