All Products
Search
Document Center

Alibaba Cloud DNS:DescribeSubDomainRecords

Last Updated:Oct 24, 2024

Queries all Domain Name System (DNS) records of a subdomain name based on the specified parameters.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:DescribeSubDomainRecordsget
  • Domain
    acs:alidns::{#accountId}:domain/{#DomainName}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
LangstringNo

The language.

en
UserClientIpstringNo

The IP address of the client.

192.0.2.0
SubDomainstringYes

If you set SubDomain to a.www.example.com and leave

DomainName empty, the system returns the DNS records that contain the hostname a.www for the domain name example.com. If you set SubDomain to a.www.example.com and set DomainName to www.example.com, the system returns the DNS records that contain the hostname a for the domain name www.example.com. If you set SubDomain to a.www.example.com and set DomainName to a.www.example.com, the system returns the DNS records that contain the hostname @ for the domain name a.www.example.com.

a.www.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 100. Default value: 20.

20
TypestringNo

The type of DNS records. If you do not specify this parameter, all types of DNS records for the subdomain name are returned.

Valid values: A, MX, CNAME, TXT, REDIRECT_URL, FORWORD_URL, NS, AAAA, and SRV.

MX
LinestringNo

The DNS resolution line.

default
DomainNamestringNo

The domain name.

example.com

Response parameters

ParameterTypeDescriptionExample
object
TotalCountlong

The total number of entries returned.

2
PageSizelong

The number of entries per page.

2
RequestIdstring

The request ID.

536E9CAD-DB30-4647-AC87-AA5CC38C5382
DomainRecordsarray<object>

The returned DNS records.

Recordobject
Statusstring

The status of the DNS record.

Enable
Typestring

The type of the DNS record.

CNAME
Weightinteger

The weight of the DNS record.

10
Valuestring

The record value.

example.net
TTLlong

The time-to-live (TTL) of the DNS record.

600
Linestring

The DNS resolution line.

default
RecordIdstring

The ID of the DNS record.

9999985
Prioritylong

The priority of the mail exchanger (MX) record.

2
RRstring

The hostname.

www
DomainNamestring

The domain name.

example.com
Lockedboolean

The lock status of the DNS record.

false
Remarkstring

The description of the DNS record.

test
PageNumberlong

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

1

Examples

Sample success responses

JSONformat

{
  "TotalCount": 2,
  "PageSize": 2,
  "RequestId": "536E9CAD-DB30-4647-AC87-AA5CC38C5382",
  "DomainRecords": {
    "Record": [
      {
        "Status": "Enable",
        "Type": "CNAME",
        "Weight": 10,
        "Value": "example.net",
        "TTL": 600,
        "Line": "default",
        "RecordId": "9999985",
        "Priority": 2,
        "RR": "www",
        "DomainName": "example.com",
        "Locked": false,
        "Remark": "test"
      }
    ]
  },
  "PageNumber": 1
}

Error codes

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

Change history

Change timeSummary of changesOperation
No change history