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 information
By default, the IP addresses of Alibaba Cloud DNS servers are specified for the ECS instance that you create. 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.
- 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.c5, 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.- For more information about how to upgrade an ECS instance, see Upgrade the instance types of subscription instances and Change the instance type of a pay-as-you-go instance.
- For more information about how to release an ECS instance, see Release an instance.
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 Advanced VPC features. - If a VPC contains an ECS instance that belongs to one of the following instance families,
you cannot configure advanced features for the VPC.
Create a DHCP options set
Modify a DHCP options set
After you create a DHCP options set, you can modify it.
- Log on to the VPC console.
- In the left-side navigation pane, click DHCP Options Sets.
- On the DHCP Options Sets page, find the DHCP options set, and click Edit in the Actions column.
- 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 with a VPC
- Log on to the VPC console.
- In the left-side navigation pane, click DHCP Options Sets.
- On the DHCP Options Sets page, find the DHCP options set that you want to manage and click Associate in the Actions column.
- In the Associate dialog box, select the VPCs to be associated and click OK.
Replace the DHCP options set associated with a VPC
After you associate a DHCP options set with a VPC, you can replace the DHCP options set based on your business requirements.
- Log on to the VPC console.
- In the top navigation bar, select the region where the VPC is deployed.
- On the VPCs page, find the VPC that you want to manage and click its ID.
- In the VPC Details section, click Modify Association next to DHCP Options Set.
- 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.
- Log on to the VPC console.
- In the left-side navigation pane, click DHCP Options Sets.
- On the DHCP Options Sets page, find the DHCP options set and click its ID.
- In the Associated VPCs section, find the VPC to be disassociated, and click Disassociate in the Actions column.
- 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.
- Log on to the VPC console.
- In the left-side navigation pane, click DHCP Options Sets.
- On the DHCP Options Sets page, find the DHCP options set, and click Delete in the Actions column.
- In the message that appears, click OK.
References
- CreateDhcpOptionsSet: creates a DHCP options set.
- UpdateDhcpOptionsSetAttribute: modifies the configuration of a DHCP options set.
- AttachDhcpOptionsSetToVpc: associates a DHCP options set with a VPC.
- ReplaceVpcDhcpOptionsSet: replaces the DHCP options set associated with a VPC.
- DetachDhcpOptionsSetFromVpc: disassociates a DHCP options set from a VPC.
- DeleteDhcpOptionsSet: deletes a DHCP options set.