API
  • History
  • Introduction
  • API Category
  • Making API Requests
    • Request Structure
    • Common Params
    • Signature v3
    • Signature
    • Responses
  • Site APIs
    • CreateZone
    • DescribeIdentifications
    • ModifyZone
    • DeleteZone
    • ModifyZoneStatus
    • CheckCnameStatus
    • IdentifyZone
    • DescribeZones
    • VerifyOwnership
    • ExportZoneConfig
    • ImportZoneConfig
    • DescribeZoneConfigImportResult
  • Acceleration Domain Management APIs
    • CreateAccelerationDomain
    • DescribeAccelerationDomains
    • ModifyAccelerationDomain
    • ModifyAccelerationDomainStatuses
    • DeleteAccelerationDomains
    • CreateSharedCNAME
    • BindSharedCNAME
    • DeleteSharedCNAME
  • Site Acceleration Configuration APIs
    • CreateRule
    • DeleteRules
    • DescribeHostsSetting
    • DescribeRules
    • DescribeRulesSetting
    • DescribeZoneSetting
    • ModifyRule
    • ModifyZoneSetting
  • Edge Function APIs
    • CreateFunction
    • DescribeFunctions
    • ModifyFunction
    • CreateFunctionRule
    • DeleteFunction
    • DescribeFunctionRules
    • ModifyFunctionRule
    • ModifyFunctionRulePriority
    • DeleteFunctionRules
    • DescribeFunctionRuntimeEnvironment
    • HandleFunctionRuntimeEnvironment
  • Alias Domain APIs
    • CreateAliasDomain
    • DescribeAliasDomains
    • ModifyAliasDomain
    • ModifyAliasDomainStatus
    • DeleteAliasDomain
  • Security Configuration APIs
    • CreateSecurityIPGroup
    • DescribeSecurityIPGroup
    • ModifySecurityIPGroup
    • DeleteSecurityIPGroup
    • DescribeOriginProtection
    • DescribeSecurityTemplateBindings
    • ModifySecurityPolicy
    • BindSecurityTemplateToEntity
    • DescribeSecurityIPGroupInfo
  • Layer 4 Application Proxy APIs
    • CreateL4Proxy
    • ModifyL4Proxy
    • ModifyL4ProxyStatus
    • DescribeL4Proxy
    • DeleteL4Proxy
    • CreateL4ProxyRules
    • ModifyL4ProxyRules
    • ModifyL4ProxyRulesStatus
    • DescribeL4ProxyRules
    • DeleteL4ProxyRules
    • CreateApplicationProxy
    • ModifyApplicationProxy
    • ModifyApplicationProxyStatus
    • DescribeApplicationProxies
    • DeleteApplicationProxy
    • CreateApplicationProxyRule
    • ModifyApplicationProxyRule
    • ModifyApplicationProxyRuleStatus
    • DeleteApplicationProxyRule
  • Content Management APIs
    • CreatePurgeTask
    • DescribePurgeTasks
    • CreatePrefetchTask
    • DescribePrefetchTasks
    • DescribeContentQuota
  • Data Analysis APIs
    • DescribeDDoSAttackData
    • DescribeDDoSAttackEvent
    • DescribeDDoSAttackTopData
    • DescribeOverviewL7Data
    • DescribeTimingL4Data
    • DescribeTimingL7AnalysisData
    • DescribeTopL7AnalysisData
    • DescribeTimingL7CacheData
    • DescribeTopL7CacheData
  • Log Service APIs
    • DownloadL7Logs
    • DownloadL4Logs
    • CreateCLSIndex
    • CreateRealtimeLogDeliveryTask
    • ModifyRealtimeLogDeliveryTask
    • DeleteRealtimeLogDeliveryTask
    • DescribeRealtimeLogDeliveryTasks
  • Billing APIs
    • CreatePlan
    • UpgradePlan
    • RenewPlan
    • ModifyPlan
    • IncreasePlanQuota
    • DestroyPlan
    • CreatePlanForZone
    • BindZoneToPlan
    • DescribeBillingData
    • DescribeAvailablePlans
  • Certificate APIs
    • DescribeDefaultCertificates
    • ModifyHostsCertificate
  • Load Balancing APIs
    • CreateOriginGroup
    • ModifyOriginGroup
    • DeleteOriginGroup
    • DescribeOriginGroup
    • CreateLoadBalancer
    • ModifyLoadBalancer
    • DeleteLoadBalancer
    • DescribeLoadBalancerList
    • DescribeOriginGroupHealthStatus
  • Custom Response Page APIs
    • CreateCustomizeErrorPage
    • DescribeCustomErrorPages
    • ModifyCustomErrorPage
    • DeleteCustomErrorPage
  • DNS Record APIs
    • CreateDnsRecord
    • DeleteDnsRecords
    • DescribeDnsRecords
    • ModifyDnsRecordsStatus
    • ModifyDnsRecords
  • Diagnostic Tool APIs
    • DescribeIPRegion
  • Version Management APIs
    • CreateConfigGroupVersion
    • DeployConfigGroupVersion
    • DescribeConfigGroupVersionDetail
    • DescribeConfigGroupVersions
    • DescribeDeployHistory
    • DescribeEnvironments
  • Data Types
  • Error Codes
このページは現在英語版のみで提供されており、日本語版も近日中に提供される予定です。ご利用いただきありがとうございます。

DescribeDnsRecords

1. API Description

Domain name for API request: teo.intl.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 NameRequiredTypeDescription
ActionYesStringCommon Params. The value used for this API: DescribeDnsRecords.
VersionYesStringCommon Params. The value used for this API: 2022-09-01.
RegionNoStringCommon Params. This parameter is not required.
ZoneIdYesStringThe site ID of the DNS record.
OffsetNoIntegerThe page offset. Default value: 0
LimitNoIntegerThe paginated query limit. Default value: 20. Maximum value: 1000.
Filters.NNoArray of AdvancedFilterThe upper limit of Filters.Values is 20. The detailed filtering conditions are as follows:
  • id: Filter by DNS record ID, supports fuzzy query;
  • name: Filter by DNS record name, supports fuzzy query;
  • content: Filter by DNS record content, supports fuzzy query;
  • type: Filter by DNS record type, does not support fuzzy query. Options:
    A: Point the domain name to an external IPv4 address, such as 8.8.8.8;
    AAAA: Point the domain name to an external IPv6 address;
    CNAME: Point the domain name to another domain name, which then resolves to the final IP address;
    TXT: Identify and describe the domain name, often used for domain verification and SPF records (anti-spam);
    NS: If you need to delegate subdomain resolution to another DNS service provider, you need to add an NS record. Root domains cannot add NS records;
    CAA: Specify the CA that can issue certificates for this site;
    SRV: Identify a server using a specific service, commonly used in Microsoft's directory management;
    MX: Specify the recipient's mail server.
  • ttl: Filter by the time-to-live (TTL) of the record, does not support fuzzy query.
  • SortByNoStringSort criteria, with possible values:
  • content: DNS record content;
  • created-on: DNS record creation time;
  • name: DNS record name;
  • ttl: Time-to-live (TTL);
  • type: DNS record type.

  • The default sorting is based on a combination of type and name attributes.
    SortOrderNoStringList sorting order, with possible values:
  • asc: Ascending order;
  • desc: Descending order.

  • The default value is asc.
    MatchNoStringThe match mode. Values:
  • all: Return all records that match the specified filter.
  • any: Return any record that matches the specified filter.
  • Default value: all.

    3. Output Parameters

    Parameter NameTypeDescription
    TotalCountIntegerTotal number of DNS records.
    DnsRecordsArray of DnsRecordList of DNS records
    RequestIdStringThe 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 for a specified record ID.

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

    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 for the specified record name.

    Perform a fuzzy query for DNS records with the name 'example' under the site with ZoneId zone-2zo8myp3av8i, and sort the records 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 for the specified record type.

    Query the DNS record list with the record type CNAME under the site with ZoneId zone-2zo8myp3av8i, and sort the records 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.