Quick start with Alibaba Cloud CLI domain commands

Updated at:

With Alibaba Cloud CLI domain commands, you can query domain names and manage DNS records in the terminal, or hand the work to an AI assistant. This topic describes installation, common commands, and usage examples.

Install the CLI

Run the following command. The script automatically installs or upgrades Alibaba Cloud CLI and installs the domain plug-in.

macOS/Linux

curl -fsSL https://aliyuncli.alicdn.com/cli-ext/domain-cli/install.sh | bash

Windows PowerShell

irm https://aliyuncli.alicdn.com/cli-ext/domain-cli/install.ps1 | iex

Windows CMD

powershell -c "irm https://aliyuncli.alicdn.com/cli-ext/domain-cli/install.ps1 | iex"

After installation, run:

aliyun domain --help

If the list of domain commands is displayed, the installation is successful. If command not found is returned, restart the terminal and try again.

For first-time use, run:

aliyun domain login

Complete the authorization in the browser. No AccessKey is required.

Common CLI commands

In the examples, replace example.com with your actual domain name.

What you want to do

Command

View the domain names under your account

aliyun domain list --page 1 --limit 20

Filter by status or expiration date

aliyun domain search --status renewal-required; aliyun domain search --expires-from 2027-01-01 --expires-to 2027-01-31

Check whether a domain name can be registered and view the reference price

aliyun domain check --domain example.com; aliyun domain price --domain example.com --years 2

View or add DNS records

aliyun domain dns list --domain example.com; aliyun domain dns create --domain example.com --host www --type A --value 192.0.2.1

Check transfer-in eligibility

aliyun domain transfer-in check --domain example.com

Enable the transfer prohibition lock

aliyun domain transfer-lock --domains example.com --status on

Check identity verification status

aliyun domain verification domain-status --domain example.com

Submit identity verification materials

aliyun domain template verify --template-id <template ID> --input-file ./verify.json

Transfer ownership or change the registrant

aliyun domain set-contact --domains example.com --template-id <template ID> --type registrant

Check logon status or log out

aliyun domain auth; aliyun domain whoami; aliyun domain logout --confirm=true

For more commands, see the aliyun domain command reference.

Usage examples

You can send the following examples directly to an AI assistant, or run the corresponding commands in the terminal. Replace example.com with your actual domain name.

Check renewal and redemption status

aliyun domain search --status renewal-required
aliyun domain search --status redemption-required
aliyun domain price --domain example.com

You can also tell the AI assistant: "Find the domain names under my account that need renewal or redemption and give me the reference prices."

Domain name identity verification

aliyun domain verification domain-status --domain example.com

You can also tell the AI assistant: "Check the identity verification status of example.com."

To submit identity verification materials for an information template, use aliyun domain template verify --template-id <template ID> --input-file ./verify.json. By default, the command only previews the submission, and the materials are submitted only after you confirm. A successful submission does not mean that the review has passed.

Transfer domain name ownership

aliyun domain set-contact --domains example.com --template-id <template ID> --type registrant

Review the preview first, and then add --confirm=true to submit after checking. You can also tell the AI assistant: "Use a verified template to change the registrant information of example.com to <template ID>. Show me the preview first."

This operation requires an information template that has passed verification. After submission, a 60-day transfer-out restriction is triggered. For complete transfer-of-ownership rules and suffix restrictions, see the console.

Precautions and FAQ

Precautions

  • Check the preview before making changes. Confirm that the target domain name and the changes are correct before submitting.

FAQ

  • Error: aliyun: command not found. What should I do?

    Add the installation directory to PATH, reopen the terminal, and try again.

  • The domain command is not available. What should I do?

    Run aliyun plugin install --names aliyun-cli-domain to install the domain plug-in.

  • The authorization page did not open automatically in the browser. What should I do?

    Copy the authorization link from the command output, open it in a browser, and complete the authorization.

  • The settings did not change after I ran a modification command. What should I do?

    Modification commands only preview the change by default. Check the preview, add the confirmation parameter, and run the command again.

  • trade detail returns INTERNAL. What does it mean?

    If the error body contains DomainNotOnSale, the domain name is not currently on sale. This is not a system failure or a parameter error, and you do not need to retry.

For more information, see the aliyun domain usage guide.