Help Center/ Domain Name Service/ CLI Reference/ CLI Command Reference
Updated on 2026-08-26 GMT+08:00

CLI Command Reference

Version Management

API Name

Command

Description

Operation

Obtaining API Versions

hcloud DNS ListApiVersions

This API is used to query all API versions supported by the DNS service.

Go debug

Querying a Specified API Version

hcloud DNS ShowApiInfo

This API is used to query a specific DNS API version.

Go debug

Public Zone Management

API Name

Command

Description

Operation

Querying the Public Zones

hcloud DNS ListPublicZones

This API is used to query information about all public zones. The information includes the domain name, zone ID, status, number of record sets, enterprise project, tags, TTL, creation time, modification time, and description.

Go debug

Querying a Public Zone

hcloud DNS ShowPublicZone

This API is used to query information about a public zone. The information includes the domain name, zone ID, status, number of record sets, enterprise project, tags, TTL, creation time, modification time, and description.

Go debug

Querying Name Servers in a Public Zone

hcloud DNS ShowPublicZoneNameServer

This API is used to query the name server information of a public zone after the public zone is created. The information includes the host name and priority.

Go debug

Deleting a Public Zone

hcloud DNS DeletePublicZone

This API is used to delete a public zone when it is no longer used.

Go debug

Modifying a Public Zone

hcloud DNS UpdatePublicZone

This API is used to modify the basic information of a public zone, including the TTL and description.

Go debug

Setting the Status of a Public Zone

hcloud DNS UpdatePublicZoneStatus

This API is used to set the status of a public zone such as disabling and enabling a public zone.

Go debug

Creating a Public Zone

hcloud DNS CreatePublicZone

Before configuring DNS resolution for your domain name, you need to add the domain name to the DNS console.

Go debug

Creating a Request for Reclaiming a Public Zone

hcloud DNS CreateRetrieval

This API is used to create a request for reclaiming a public zone.

Go debug

Querying the Request for Reclaiming a Public Zone

hcloud DNS ShowRetrieval

This API is used to query the request for reclaiming a public zone.

Go debug

Verifying the Public Zone Reclaiming Result

hcloud DNS CreateRetrievalVerification

This API is used to verify the public zone reclaiming result.

Go debug

Querying the Public Zone Reclaiming Result

hcloud DNS ShowRetrievalVerification

This API is used to query the public zone reclaiming result.

Go debug

Creating an Authorization Task for a Public Subdomain

hcloud DNS CreateAuthorizeTxtRecord

When you create a subdomain, the system displays a message indicating that the domain conflicts with that of another tenant and you need to add a TXT record for verification. You can call the API to generate the TXT record verification information for the subdomain.

Go debug

Querying the Authorization Task of a Public Subdomain

hcloud DNS ShowAuthorizeTxtRecord

This API is used to query the TXT record verification information of the subdomain.

Go debug

Verifying the Authorization Status of a Public Subdomain

hcloud DNS CreateAuthorizeTxtRecordVerification

After adding a TXT record at the DNS service provider of the second-level domain, you can call this API to verify the subdomain authorization status.

Go debug

Private Zone Management

API Name

Command

Description

Operation

Creating a Private Zone

hcloud DNS CreatePrivateZone

After a private zone is created, you can associate it with a private IP address to provide private domain name resolution in the VPC for cloud services.

Go debug

Associating a VPC with a Private Zone

hcloud DNS AssociateRouter

This API is used to associate a new VPC with a private zone after the private zone is created.

Go debug

Disassociating a VPC from a Private Zone

hcloud DNS DisassociateRouter

This API is used to disassociate a VPC from a private zone after the private zone is created.

Go debug

Querying a Private Zone

hcloud DNS ShowPrivateZone

This API is used to query information about a private zone. The information includes the domain name, zone ID, status, number of record sets, enterprise project, tags, TTL, creation time, modification time, and description.

Go debug

Querying the Private Zones

hcloud DNS ListPrivateZones

This API is used to query information about a private zone. The information includes the domain name, zone ID, status, number of record sets, enterprise project, tags, TTL, creation time, modification time, and description.

Go debug

Querying Name Servers in a Private Zone

hcloud DNS ShowPrivateZoneNameServer

This API is used to query the name server information of a private zone after the private zone is created. The information includes the priority and DNS server address.

Go debug

Deleting a Private Zone

hcloud DNS DeletePrivateZone

This API is used to delete a private zone when it is no longer used.

Go debug

Modifying a Private Zone

hcloud DNS UpdatePrivateZone

This API is used to modify the basic information of a private zone, including the TTL and description.

Go debug

Setting the Status of a Private Zone

hcloud DNS UpdatePrivateZoneStatus

This API is used to set the status of a private zone, such as disabling and enabling the private zone.

Go debug

Setting a Recursive Resolution Proxy for Subdomains in a Private Zone

hcloud DNS SetPrivateZoneProxyPattern

This API is used to enable or disable the recursive resolution proxy of subdomains after a private zone is created.

Go debug

Record Set Management (v2)

API Name

Command

Description

Operation

Creating a Record Set

hcloud DNS CreateRecordSet

This API is used to add record sets of different types to a zone.

Go debug

Querying Record Sets in a Zone

hcloud DNS ListRecordSetsByZone

This API is used to query information about all record sets in a specified zone. The information includes the name, ID, status, domain name, record value, tag, TTL, creation time, modification time, and description.

Go debug

Querying a Record Set

hcloud DNS ShowRecordSet

This API is used to query information about all record sets in a specified zone. The information includes the name, ID, status, domain name, record value, tag, TTL, creation time, modification time, and description.

Go debug

Querying Record Sets

hcloud DNS ListRecordSets

This API is used to query the record set information, including the domain name, ID, status, zone, record value, tag, TTL, creation time, modification time, and description.

Go debug

Deleting a Record Set

hcloud DNS DeleteRecordSet

This API is used to delete a record set when it is no longer used.

Go debug

Modifying a Record Set

hcloud DNS UpdateRecordSet

This API is used to modify the information of a record set, including the domain name, type, value, TTL, and description.

Go debug

Record Set Management (v2.1)

API Name

Command

Description

Operation

Creating a Record Set

hcloud DNS CreateRecordSetWithLine

This API is used to add record sets of different types to a zone.

Go debug

Deleting Record Sets in a Zone in Batches

hcloud DNS BatchDeleteRecordSetWithLine

This API is used to batch delete record sets in a zone.

Go debug

Modifying Record Sets

hcloud DNS BatchUpdateRecordSetWithLine

This API is used to modify record sets in batches. This operation is atomic. It either modifies all record sets or does not modify any record set.

Go debug

Querying a Record Set

hcloud DNS ShowRecordSetWithLine

This API is used to query the record set information, including the name, ID, status, domain name, record value, tag, TTL, creation time, modification time, and description.

Go debug

Querying Record Sets

hcloud DNS ListRecordSetsWithLine

This API is used to query the record set information, including the domain name, ID, status, zone, record value, tag, TTL, creation time, modification time, and description.

Go debug

Batch Creating Record Sets with the Same Name and Type, But Different Routing Lines

hcloud DNS CreateRecordSetWithBatchLines

This API is used to batch create record sets with the same name and type, but different routing lines. This operation is an atomic operation. If any parameter fails to pass the verification, the creation fails. Only public zones are supported.

Go debug

Querying Record Sets in a Zone

hcloud DNS ShowRecordSetByZone

This API is used to query information about all record sets in a specified zone. The information includes the domain name, ID, status, zone, record value, tags, TTL, creation time, modification time, and description.

Go debug

Deleting a Record Set

hcloud DNS DeleteRecordSets

This API is used to delete a record set when it is no longer used.

Go debug

Modifying a Record Set

hcloud DNS UpdateRecordSets

This API is used to modify the information of a record set, including the domain name, type, value, TTL, and description.

Go debug

Setting the Record Set Status

hcloud DNS SetRecordSetsStatus

This API is used to set the record set status such as disabling and enabling a record set.

Go debug

Querying Public Zone Lines

hcloud DNS ListPublicZoneLines

This API is used to query all resolution lines of a public zone after adding a record set to the zone.

Go debug

Batch Creating Record Sets

hcloud DNS BatchCreateRecordSetsTask

This API is used to submit the task for batch creating record sets and return the task ID.

Go debug

Querying the Task for Batch Creating Record Sets

hcloud DNS ShowBatchCreateRecordSetsTask

This API is used to query the task for batch creating record sets and return failed items by page.

Go debug

Deleting the Task for Batch Creating Record Sets

hcloud DNS DeleteBatchCreateRecordSetsTask

This API is used to delete the task for batch creating record sets.

Go debug

Querying Preset Resolution Lines

hcloud DNS ListSystemLines

This API is used to query preset resolution lines.

Go debug

PTR Record Management (v2)

API Name

Command

Description

Operation

Creating a PTR Record for an EIP

hcloud DNS CreateEipRecordSet

This API is used to create a PTR record for an EIP.

Go debug

Querying a PTR Record of an EIP

hcloud DNS ShowPtrRecordSet

This API is used to query a PTR record of an EIP.

Go debug

Querying PTR Records of an EIP

hcloud DNS ListPtrRecords

This API is used to query PTR records of an EIP.

Go debug

Restoring the PTR Record of an EIP to the Default Value

hcloud DNS RestorePtrRecord

This API is used to restore the PTR record of an EIP to the default value.

Go debug

Modifying a PTR Record for an EIP

hcloud DNS UpdatePtrRecord

This API is used to modify a PTR record for an EIP.

Go debug

PTR Record Management (v2.1)

API Name

Command

Description

Operation

Creating a PTR Record for an EIP

hcloud DNS CreatePtr

This API is used to create a PTR record for an EIP.

Go debug

Querying PTR Records of an EIP

hcloud DNS ListPtrs

This API is used to query PTR records of an EIP.

Go debug

Querying a PTR Record of an EIP

hcloud DNS ShowPtr

This API is used to query a PTR record of an EIP.

Go debug

Modifying a PTR Record for an EIP

hcloud DNS UpdatePtr

This API is used to modify a PTR record for an EIP.

Go debug

Restoring the PTR Record of an EIP to the Default Value

hcloud DNS DeletePtr

This API is used to restore the PTR record of an EIP to the default value.

Go debug

Tags

API Name

Command

Description

Operation

Adding a Tag to a Specific Resource

hcloud DNS CreateTag

This API is used to add a tag to a specific resource.

Go debug

Deleting a Resource Tag

hcloud DNS DeleteTag

This API is used to delete a resource tag.

Go debug

Batch Adding or Deleting Tags for a Specific Instance

hcloud DNS BatchCreateTag

This API is used to batch add or delete tags for a specific instance.

Go debug

Querying Tags of a Specific Instance

hcloud DNS ShowResourceTag

This API is used to query tags of a specific instance.

Go debug

Querying All Tags of a Specific Resource

hcloud DNS ListTags

This API is used to query all tags of a specific resource.

Go debug

Querying Resources Using Tags

hcloud DNS ListTag

This API is used to query resources using tags.

Go debug

Custom Line Management

API Name

Command

Description

Operation

Creating a Custom Line

hcloud DNS CreateCustomLine

This API is used to create a custom line.

Go debug

Querying a Custom Line

hcloud DNS ListCustomLine

This API is used to query a custom line.

Go debug

Deleting a Custom Line

hcloud DNS DeleteCustomLine

This API is used to delete a custom line.

Go debug

Modifying a Custom Line

hcloud DNS UpdateCustomLine

This API is used to modify a custom line.

Go debug

Creating a Line Group

hcloud DNS CreateLineGroup

This API is used to create a line group. This API is not available in some regions. To use this API, submit a service ticket.

Go debug

Querying Line Groups

hcloud DNS ListLineGroups

This API is used to query the line groups. This API is not available in some regions. To use this API, submit a service ticket.

Go debug

Querying a Line Group

hcloud DNS ShowLineGroup

This API is used to query a line group. This API is not available in some regions. To use this API, submit a service ticket.

Go debug

Modifying a Line Group

hcloud DNS UpdateLineGroups

This API is used to modify a line group. This API is not available in some regions. To use this API, submit a service ticket.

Go debug

Deleting a Line Group

hcloud DNS DeleteLineGroup

This API is used to delete a line group. This API is not available in some regions. To use this API, submit a service ticket.

Go debug

Name Server Management

API Name

Command

Description

Operation

Querying Name Servers

hcloud DNS ListNameServers

This API is used to query name servers.

Go debug

Quota Management

API Name

Command

Description

Operation

Querying Resource Quotas

hcloud DNS ShowDomainQuota

This API is used to query DNS resource quotas of a tenant. The resources include public zones, private zones, record sets, PTR records, custom lines, line groups, inbound endpoints, outbound endpoints, and endpoint rules.

Go debug

Resolver Management

API Name

Command

Description

Operation

Creating an Endpoint

hcloud DNS CreateEndpoint

This API is used to create an endpoint.

Go debug

Querying Endpoints

hcloud DNS ListEndpoints

This API is used to query endpoints.

Go debug

Querying an Endpoint

hcloud DNS ShowEndpoint

This API is used to query an endpoint.

Go debug

Modifying an Endpoint

hcloud DNS UpdateEndpoint

Modifying an Endpoint

Go debug

Deleting an Endpoint

hcloud DNS DeleteEndpoint

This API is used to delete a VPC endpoint.

Go debug

Binding an IP Address to an Endpoint

hcloud DNS AssociateEndpointIpaddress

This API is used to bind an IP address to an endpoint.

Go debug

Querying IP Addresses

hcloud DNS ListEndpointIpaddresses

This API is used to query the IP addresses of an endpoint.

Go debug

Unbinding an IP Address from an Endpoint

hcloud DNS DisassociateEndpointIpaddress

This API is used to unbind an IP address from the endpoint.

Go debug

Querying VPCs of an Endpoint

hcloud DNS ListEndpointVpcs

This API is used to query the VPCs of an endpoint.

Go debug

Creating an Endpoint Rule

hcloud DNS CreateResolverRule

This API is used to create an endpoint rule.

Go debug

Querying Endpoint Rules

hcloud DNS ListResolverRules

This API is used to query endpoint rules.

Go debug

Associating a VPC with an Endpoint Rule

hcloud DNS AssociateResolverRuleRouter

This API is used to associate a VPC with an endpoint rule.

Go debug

Disassociating an Endpoint Rule from a VPC

hcloud DNS DisassociateResolverRuleRouter

This API is used to disassociate an endpoint rule from a VPC.

Go debug

Querying an Endpoint Rule

hcloud DNS ShowResolverRule

This API is used to query an endpoint rule.

Go debug

Modifying an Endpoint Rule

hcloud DNS UpdateResolverRule

This API is used to modify an endpoint rule.

Go debug

Deleting an Endpoint Rule

hcloud DNS DeleteResolverRule

This API is used to delete an endpoint rule.

Go debug

Access Logging Management

API Name

Command

Description

Operation

Creating a Resolver Access Logging Configuration

hcloud DNS CreateResolverQueryLogConfig

This API is used to create a resolver access logging configuration.

Go debug

Querying the List of Resolver Access Logging Configurations

hcloud DNS ListResolverQueryLogConfigs

This API is used to query the list of resolver access logging configurations.

Go debug

Associating a Resolver Access Logging Configuration with a VPC

hcloud DNS AssociateResolverQueryLogConfig

This API is used to associate a resolver access logging configuration with a VPC.

Go debug

Disassociating a Resolver Access Logging Configuration from the VPC

hcloud DNS DisassociateResolverQueryLogConfig

This API is used to disassociate a resolver access logging configuration from the VPC.

Go debug

Querying a Resolver Access Logging Configuration

hcloud DNS ShowResolverQueryLogConfig

This API is used to query a resolver access logging configuration.

Go debug

Deleting a Resolver Access Logging Configuration

hcloud DNS DeleteResolverQueryLogConfig

This API is used to delete a resolver access logging configuration.

Go debug

Batch Operations

API Name

Command

Description

Operation

Batch Deleting Zones

hcloud DNS BatchDeleteZones

This API is used to delete zones in batches.

Go debug

Batch Deleting Record Sets

hcloud DNS BatchDeleteRecordSets

This API is used to delete record sets in batches.

Go debug

Deleting PTR Records

hcloud DNS BatchDeletePtrRecords

This API is used to delete PTR records in batches. This is an atomic operation. All PTR records are either deleted completely or not deleted at all.

Go debug

Batch Setting Zone Status

hcloud DNS BatchSetZonesStatus

This API is used to set the status of zones in batches.

Go debug

Batch Setting the Status of Record Sets

hcloud DNS BatchSetRecordSetsStatus

This API is used to set the status of record sets in batches.

Go debug

Batch Querying Resources Related to DNS Query Statistics

hcloud DNS ListInstances

This API is used to batch query resources related to DNS query statistics.

Go debug

Creating Public Zones in Batches

hcloud DNS BatchCreatePublicZonesTask

This API is used to submit the task for creating public zones in batches and return the task ID.

Go debug

Creating Record Sets for Public Zones in Batches

hcloud DNS BatchCreateCombinedPublicRecordsetsTask

This API is used to submit the task for creating record sets for public zones in batches and return the task ID.

Go debug

Creating Record Sets for Public Zones in Batches

hcloud DNS BatchCreatePublicRecordsetsTask

This API is used to submit the task for creating record sets for public zones in batches and return the task ID.

Go debug

Deleting Record Sets from Public Zones in Batches

hcloud DNS BatchDeletePublicRecordsetsTask

This API is used to submit the task for deleting record sets from public zones in batches and return the task ID.

Go debug

Modifying Record Sets of Public Zones in Batches

hcloud DNS BatchUpdatePublicRecordsetsTask

This API is used to submit the task for modifying record sets of public zones in batches and return the task ID.

Go debug

Transferring Public Zones in Batches

hcloud DNS BatchTransferPublicZonesTask

This API is used to submit the task for transferring public zones in batches and return the task ID.

Go debug

Querying the Batch Operation Task List

hcloud DNS ListBatchOperationTasks

This API is used to query the list of batch operation tasks.

Go debug

Querying the Batch Operation Task

hcloud DNS ShowBatchOperationTask

This API is used to query batch operation tasks and return failed items by page.

Go debug

DNSSEC

API Name

Command

Description

Operation

Enabling DNSSEC

hcloud DNS EnableDnssecConfig

This API is used to enable DNSSEC for a public zone.

Go debug

Disabling DNSSEC

hcloud DNS DisableDnssecConfig

This API is used to disable DNSSEC for a public zone.

Go debug

Querying DNSSEC

hcloud DNS ShowDnssecConfig

This API is used to query DNSSEC for a public zone.

Go debug

Public Zone Check

API Name

Command

Description

Operation

Querying Domain Name Check Results of a Public Zone

hcloud DNS ShowDomainDetection

This API is used to query domain name check results of a public zone.

Go debug

Querying Email Record Sets in a Public Zone

hcloud DNS ShowEmailRecordSet

This API is used to query email record sets in a public zone.

Go debug

Querying Website Record Sets in a Public Zone

hcloud DNS ShowWebsiteRecordSet

This API is used to query website record sets in a public zone.

Go debug

Querying DNS Server Addresses of a Public Zone

hcloud DNS ShowZoneNameServer

This API is used to query the DNS server addresses of a domain name and those provided by Huawei Cloud.

Go debug