All Products
Search
Document Center

Alibaba Cloud DNS:DescribeDomainRecords

Last Updated:Apr 10, 2024

Queries all Domain Name System (DNS) records of the specified primary domain names based on the specified parameters.

Operation description

  • You can specify DomainName, PageNumber, and PageSize to query the DNS records of the specified domain names.
  • You can also specify RRKeyWord, TypeKeyWord, or ValueKeyWord to query the DNS records that contain the specified keyword.
  • By default, the DNS records are sorted in reverse chronological order based on the time when they were added.
  • You can specify GroupId to query the DNS records of the specified domain names based on the group ID. You can query the DNS records of all domain names and the domain names in the default group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
alidns:DescribeDomainRecordsRead
  • Domain
    acs:alidns::{#accountId}:domain/{#DomainName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
LangstringNo

The language.

en
DomainNamestringYes

The domain name.

example.com
PageNumberlongNo

The page number. Pages start from page 1. Default value: 1.

1
PageSizelongNo

The number of entries per page. Valid values: 1 to 500. Default value: 20.

20
KeyWordstringNo

The keyword.

test
RRKeyWordstringNo

The hostname keyword based on which the system queries DNS records. The system queries DNS records based on the value of this parameter in fuzzy match mode. The value is not case-sensitive.

www
TypeKeyWordstringNo

The type keyword based on which the system queries DNS records. The system queries DNS records based on the value of this parameter in exact match mode. The value is not case-sensitive.

MX
ValueKeyWordstringNo

The record value keyword based on which the system queries DNS records. The system queries DNS records based on the value of this parameter in fuzzy match mode. The value is not case-sensitive.

com
OrderBystringNo

The method that is used to sort the returned DNS records. By default, the DNS records are sorted in reverse chronological order based on the time when they were added.

default
DirectionstringNo

The order in which you want to sort the returned DNS records. Valid values: DESC and ASC. Default value: DESC.

DESC
SearchModestringNo

The search mode. Valid values: LIKE, EXACT, and ADVANCED.

  • If you set SearchMode to LIKE or EXACT, specify KeyWord. In this case, RRKeyWord, TypeKeyWord, ValueKeyWord, Type, Line, and Status are invalid.

  • If you set SearchMode to ADVANCED, specify RRKeyWord, TypeKeyWord, ValueKeyWord, Type, Line, and Status.

  • If you do not specify SearchMode, the system determines the search mode based on the following rules:

    • If KeyWord is specified, the system uses the LIKE mode.
    • If KeyWord is not specified, the system queries DNS records based on values of RRKeyWord and ValueKeyWord in fuzzy match mode, and based on the values of TypeKeyWord, Type, Line, and Status in exact match mode.
LIKE
GroupIdlongNo

The ID of the domain name group.

  • If you do not specify GroupId, all domain names are queried.
  • If you set GroupId to 0, no value is returned.
  • If you set GroupId to 1, the domain names in the default group are queried.
  • If you set GroupId to -2, all domain names are queried.
  • You can also specify GroupId based on the actual group ID.
2223
TypestringNo

The type of the DNS records to query. For more information, see

DNS record types.

A
LinestringNo

The resolution line. Default value: default.

For more information, see

DNS lines.

cn_mobile_anhui
StatusstringNo

The status of the DNS records to query. Valid values: Enable and Disable.

Enable

Response parameters

ParameterTypeDescriptionExample
object
TotalCountlong

The total number of entries returned.

2
PageSizelong

The number of entries per page.

20
RequestIdstring

The request ID.

536E9CAD-DB30-4647-AC87-AA5CC38C5382
DomainRecordsobject []

The returned Domain Name System (DNS) records.

Statusstring

The status of the DNS record.

Enable
Typestring

The type of the DNS record.

MX
Remarkstring

The description of the DNS record.

test
TTLlong

The time-to-live (TTL) of the cached DNS record. Unit: seconds.

600
RecordIdstring

The ID of the DNS record.

9999985
Prioritylong

The priority of the mail exchanger (MX) record.

5
RRstring

The hostname.

www
DomainNamestring

The domain name.

example.com
Weightinteger

The weight of the DNS record.

2
Valuestring

The record value.

mail1.hichina.com
Linestring

The resolution line.

default
Lockedboolean

Indicates whether the DNS record is locked.

false
CreateTimestamplong

The time when the DNS record was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.

1666501957000
UpdateTimestamplong

The time when the DNS record was updated. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since 00:00:00 UTC on January 1, 1970.

1676872961000
PageNumberlong

The page number.

1

Examples

Sample success responses

JSONformat

{
  "TotalCount": 2,
  "PageSize": 20,
  "RequestId": "536E9CAD-DB30-4647-AC87-AA5CC38C5382",
  "DomainRecords": {
    "Record": [
      {
        "Status": "Enable",
        "Type": "MX",
        "Remark": "test",
        "TTL": 600,
        "RecordId": "9999985",
        "Priority": 5,
        "RR": "www",
        "DomainName": "example.com",
        "Weight": 2,
        "Value": "mail1.hichina.com",
        "Line": "default",
        "Locked": false,
        "CreateTimestamp": 1666501957000,
        "UpdateTimestamp": 1676872961000
      }
    ]
  },
  "PageNumber": 1
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2023-09-20The response structure of the API has changedsee changesets
Change itemChange content
Output ParametersThe response structure of the API has changed.