All Products
Search
Document Center

Virtual Private Cloud:ListDhcpOptionsSets

Last Updated:Aug 28, 2026

Queries Dynamic Host Configuration Protocol (DHCP) options sets.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The region ID of the DHCP options sets that you want to query.

You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

NextToken

string

No

The pagination token that is used in the next request to retrieve a new page of results.

  • Not required for the first request.

  • Set this to the NextToken value returned by the previous query.

FFmyTO70tTpLG6I3FmYAXGKPd****

MaxResults

integer

No

The number of entries per page. Valid values: 1 to 100. Default value: 10.

10

DomainName

string

No

The root domain. For example, you can set the value to example.com.

After a DHCP options set is associated with a VPC, the root domain is automatically synchronized with the ECS instances in the VPC.

Valid values:

  • example.com :

    example.com

example.com

DhcpOptionsSetName

string

No

The name of the DHCP options set.

The name must be 1 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter.

Valid values:

  • tf-testAccVpcDhcpOptionsSets-1585169790614573448

    :

    tf-testAccVpcDhcpOptionsSets-1585169790614573448

    .

Valid values:

  • tf-testAccVpcDhcpOptionsSets-1585169790614573448 :

    tf-testAccVpcDhcpOptionsSets-1585169790614573448

test

DhcpOptionsSetId

array

No

The ID of the DHCP options set. You can specify at most 20 IDs.

dopt-o6w0df4epg9zo8isy****

string

No

The ID of the DHCP options set. You can specify at most 20 IDs.

dopt-o6w0df4epg9zo8isy****

ResourceGroupId

string

No

The ID of the resource group to which the DHCP options set belongs.

rg-acfmxazb4ph****

Tags

array<object>

No

The tags.

object

No

The tags.

Key

string

No

The tag key. You can specify up to 20 tag keys. It cannot be an empty string.

The tag key can be up to 64 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceDept

Value

string

No

The tag value. You can specify up to 20 tag values. It can be an empty string.

The tag value can be up to 128 characters in length and can contain digits, periods (.), underscores (_), and hyphens (-). It must start with a letter but cannot start with aliyun or acs:. It cannot contain http:// or https://.

FinanceJoshua

Response elements

Element

Type

Description

Example

object

The pagination token for the next request. Valid values:

  • If NextToken is empty, no next page exists.

  • If a value of NextToken is returned, use it to retrieve the next page of results.

NextToken

string

A pagination token. It can be used in the next request to retrieve a new page of results.

  • If NextToken is empty, no next page exists.

  • If a value is returned for NextToken, use it to retrieve the next page of results.

FFmyTO70tTpLG6I3FmYAXGKPd********

RequestId

string

The request ID.

0ED8D006-F706-4D23-88ED-E11ED28DCAC0

DhcpOptionsSets

array<object>

The DHCP options sets.

array<object>

The DHCP options sets.

DhcpOptionsSetDescription

string

The description of the DHCP options set.

test

Status

string

The status of the DHCP options set. Valid values:

  • Available

  • InUse

  • Pending

  • Deleted

Available

DhcpOptionsSetId

string

The ID of the DHCP options set.

dopt-o6w0df4epg9zo8isy****

DhcpOptionsSetName

string

The name of the DHCP options set.

test

AssociateVpcCount

integer

The number of VPCs with which the DHCP options set is associated.

2

OwnerId

integer

The ID of the Alibaba Cloud account to which the DHCP options set belongs.

253460731706911258

DhcpOptions

object

The DHCP options.

DomainNameServers

string

The IP address of the DNS server.

192.168.XX.XX

DomainName

string

The suffix of the hostname.

example.com

LeaseTime

string

The lease time of the IPv4 addresses for the DHCP options set.

  • If you use hours as the unit, valid values are 24h to 1176h and 87600h to 175200h. Default value: 87600h.

  • If you use days as the unit, valid values are 1d to 49d and 3650d to 7300d. Default value: 3650d.

3650d

Ipv6LeaseTime

string

The lease time of the IPv6 DHCP options set.

  • If you use hours as the unit, valid values are 24h to 1176h and 87600h to 175200h. Default value: 24h.

  • If you use days as the unit, valid values are 1d to 49d and 3650d to 7300d. Default value: 1d.

3650d

ResourceGroupId

string

The ID of the resource group to which the DHCP options set belongs.

rg-acfmxazb4ph****

Tags

array<object>

The tags.

object

The tags.

Key

string

The key of tag N added to the resource.

FinanceDept

Value

string

The value of tag N added to the resource.

FinanceJoshua

CreationTime

string

The time when the DHCP options set was created.

2025-08-21 ***

TotalCount

string

The total number of entries returned.

10

Examples

Success response

JSON format

{
  "NextToken": "FFmyTO70tTpLG6I3FmYAXGKPd********",
  "RequestId": "0ED8D006-F706-4D23-88ED-E11ED28DCAC0",
  "DhcpOptionsSets": [
    {
      "DhcpOptionsSetDescription": "test",
      "Status": "Available",
      "DhcpOptionsSetId": "dopt-o6w0df4epg9zo8isy****",
      "DhcpOptionsSetName": "test",
      "AssociateVpcCount": 2,
      "OwnerId": 253460731706911260,
      "DhcpOptions": {
        "DomainNameServers": "192.168.XX.XX",
        "DomainName": "example.com",
        "LeaseTime": "3650d",
        "Ipv6LeaseTime": "3650d"
      },
      "ResourceGroupId": "rg-acfmxazb4ph****",
      "Tags": [
        {
          "Key": "FinanceDept",
          "Value": "FinanceJoshua"
        }
      ],
      "CreationTime": "2025-08-21 ***"
    }
  ],
  "TotalCount": "10"
}

Error codes

HTTP status code

Error code

Error message

Description

400 IllegalParam.NextToken The specified NextToken is invalid. The specified NextToken is invalid.
400 InvalidRegionId.NotFound The specified RegionId does not exist. The specified region does not exist.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.