edit-icon download-icon

Retrieving Primary Domain Names

Last Updated: May 27, 2016

Description

The primary domain name is obtained through input parameters. For information on the primary domain name and sub-domain levels, please refer to the Domain Name Level. If www.abc.com is the input, the output will be abc.com.

Request Parameters

Name Type Required? Description
Action String Yes Operator interface name, required parameter, value:GetMainDomainName
InputString String Yes The string shall have a maximum of 128 characters

Return Parameters

Public return parameters. For details, see Public Return Parameters

Name Type Description
RequestId String The unique request identifier
DomainName String Domain name
RR String The host record
DomainLevel Long The level of the input domain name

Error Codes

For errors common to all interfaces, please refer to the Error Code Table.

Error Code Description HTTP Status Code Meaning
InvalidDomainName.Format The format of domain is error. 400 Invalid domain name format
QuotaExceeded.StringLength You Can’t finish this operation because the input string length has been out of MAX count. 400 The string length has exceeded limit

Example

Request Example

http://dns.aliyuncs.com/?Action=GetMainDomainName
&InputString=www.example.com
&<Public Request Parameters>

Return Example

XML Format

<GetMainDomainNameResponse>
    <RequestId>536E9CAD-DB30-4647-AC87-AA5CC38C5382</RequestId>
    <DomainName>example.com</DomainName>
    <RR>www</RR>
    <DomainLevel>2</DomainLevel>
</GetMainDomainNameResponse>

JSON Example

{
    "RequestId": "536E9CAD-DB30-4647-AC87-AA5CC38C5382",
    "DomainName": "example.com",
    "RR": "www",
    "DomainLevel": 2
}
Thank you! We've received your feedback.