You can use Dynamic Host Configuration Protocol (DHCP) options sets to configure DNS server IP addresses and domain names for Elastic Compute Services (ECS) instances in virtual private clouds (VPCs). Before you can use a DHCP options set, you must create one and specify the DNS server IP addresses and domain names that your business requires. Then, you can associate the DHCP options set with a VPC. After the DHCP options set is associated with the VPC, newly created ECS instances in the VPC use the configurations of the DHCP options set. After the DHCP options set is synchronized with existing ECS instances, existing ECS instances also use the configurations of the DHCP options set.

Operations

Background

By default, the IP addresses of the Alibaba Cloud DNS servers are specified for the ECS instance that you create. The Alibaba Cloud DNS servers cannot resolve private domain names. You can specify custom DNS server IP addresses for your ECS instance. However, the custom configurations are cleared after you restart the ECS instance.

You can associate a DHCP options set with a VPC. Then, newly created ECS instances in the VPC use the configurations of the DHCP options set. After the DHCP options set is synchronized with existing ECS instances, existing ECS instances also use the configurations of the DHCP options set. For more information, see Overview.
  • A DHCP options set can be associated with only VPCs deployed in the region where the DHCP options set is created.
  • A DHCP options set can be associated with multiple VPCs. However, a VPC can be associated with only one DHCP options set.

    By default, a DHCP options set can be associated with up to 10 VPCs. You cannot increase the quota.

  • Advanced VPC features, including DHCP options sets, have the following limits on ECS instance families:
    • If a VPC contains an ECS instance that belongs to one of the following instance families, you cannot configure advanced features for the VPC.

      ecs.c1, ecs.c2, ecs.c4, ecs.ce4, ecs.cm4, ecs.d1, ecs.e3, ecs.e4, ecs.ga1, ecs.gn4, ecs.gn5, ecs.i1, ecs.m1, ecs.m2, ecs.mn4, ecs.n1, ecs.n2, ecs.n4, ecs.s1, ecs.s2, ecs.s3, ecs.se1, ecs.sn1, ecs.sn2, ecs.t1, and ecs.xn4.

    • After you configure an advanced feature for a VPC, you cannot create ECS instances of the preceding instance families in the VPC, or migrate such ECS instances to the VPC.
    To resolve this problem, you must upgrade or release the ECS instances that do not support advanced VPC features.
    Note If your VPC contains ECS instances of the preceding instance families and has DHCP options sets configured, you must upgrade or release the ECS instances. Otherwise, the DHCP options sets may not work as expected. For more information, see Overview of VPC advanced features.
DHCP options sets

Create a DHCP options set

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click DHCP Options Sets.
  3. In the top navigation bar, select the region where you want to create the DHCP options set.
    For more information about regions that support DHCP options sets, see Features and supported regions.
  4. On the DHCP Options Sets page, click Create DHCP Options Set.
  5. On the Create DHCP Options Set page, set the following parameters.
    Parameter Description
    Basic Information
    Instance Name Enter a name for the DHCP options set.

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

    Description Enter a description for the DHCP options set.

    The description must be 2 to 256 characters in length and cannot start with http:// or https://.

    DHCP Options Set Configuration
    Domain Name Enter a root domain name.

    After you associate the DHCP options set with a VPC, the domain name is synchronized to the ECS instances deployed in the VPC.

    example.com in used in this example.

    DNS Server IP Address Enter DNS server IP addresses.
    The IP addresses of the Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138, are used by default. This ensures that you can access basic services deployed on Alibaba Cloud. You can click Customize DNS server IP addresses to specify custom DNS server IP addresses to meet your requirements. You can specify up to four DNS server IP addresses.
    Notice Before you specify custom DNS server IP addresses, take note of the following limits:
    • The system automatically specifies the IP addresses of the Alibaba Cloud DNS servers, which are 100.100.2.136 and 100.100.2.138. If you delete these IP addresses, you may not be able to access the basic services deployed on Alibaba Cloud. Proceed with caution.
    • You must add rules to the security group and network access control lists (ACLs) to enable access to the specified custom DNS servers. Otherwise, the services deployed on your ECS instances cannot be resolved. If network ACLs do not exist, add rules to only the security group. For more information, see Add security group rules and Add network ACL rules.

    192.168.1.1 is used in this example.

  6. Click OK.
  7. On the DHCP Options Sets page, find the DHCP options set, and click Edit in the Actions column.
  8. Optional:On the Modify DHCP Options Set page, you can modify the name, description, domain name, and DNS server IP addresses of the DHCP options set. Then, click OK.

Modify a DHCP options set

After you create a DHCP options set, you can modify it.

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click DHCP Options Sets.
  3. On the DHCP Options Sets page, find the DHCP options set, and click Edit in the Actions column.
  4. On the Modify DHCP Options Set page, you can modify the name, description, domain name, and DNS server IP addresses of the DHCP options set. Then, click OK.

Associate a VPC with a DHCP options set

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click DHCP Options Sets.
  3. On the DHCP Options Sets page, find the DHCP options set that you want to manage and click Associate in the Actions column.
  4. In the Associate dialog box, select the VPCs to be associated and click OK.

Change an associated DHCP options set

After you associate a DHCP options set with a VPC, you can change the DHCP options set based on your business requirements.

  1. Log on to the VPC console.
  2. In the top navigation bar, select the region where the VPC is deployed.
  3. On the VPCs page, find the VPC and click its ID.
  4. In the VPC Details section, click Modify Association on the right of DHCP Options Set.
  5. In the Associate DHCP Options Set dialog box, select the DHCP options set that you want to associate, and click OK.

Disassociate a DHCP options set from a VPC

You can disassociate a DHCP options set from a VPC. Then, ECS instances in the VPC no longer use the configurations of the DHCP options set.

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click DHCP Options Sets.
  3. On the DHCP Options Sets page, find the DHCP options set and click its ID.
  4. In the Associated VPCs section, find the VPC to be disassociated, and click Disassociate in the Actions column.
  5. In the message that appears, click OK.

Delete a DHCP options set

Make sure that the DHCP options set to be deleted is not associated with a VPC.

  1. Log on to the VPC console.
  2. In the left-side navigation pane, click DHCP Options Sets.
  3. On the DHCP Options Sets page, find the DHCP options set, and click Delete in the Actions column.
  4. In the message that appears, click OK.